Skip to content

Commit

Permalink
fix(parsing): update return value of song number extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao authored Apr 11, 2024
1 parent 75faca9 commit f5d9b5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/parsing_rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export const extractSongNumber = (src: string) => {
const parseNum = src.match(/(\d+)/);

if (parseNum && parseNum.length > 0) {
return +parseNum![0];
const firstNumber = parseNum[0];

if (!isNaN(firstNumber) && firstNumber <= 158) {
return +firstNumber;
}
}

return src;
Expand Down

0 comments on commit f5d9b5e

Please sign in to comment.