From f5d9b5ed906af507f8c791e94395d052b4f21061 Mon Sep 17 00:00:00 2001 From: "Rasamoelina, Haja Onjatiana" <26148770+rhahao@users.noreply.github.com> Date: Thu, 11 Apr 2024 14:23:42 +0300 Subject: [PATCH] fix(parsing): update return value of song number extraction --- src/common/parsing_rules.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/parsing_rules.ts b/src/common/parsing_rules.ts index abefba19..7950ac47 100644 --- a/src/common/parsing_rules.ts +++ b/src/common/parsing_rules.ts @@ -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;