From 605bd73c11aa2b79552a1da26f6c29ff904b899a Mon Sep 17 00:00:00 2001 From: Techwolf Date: Sun, 1 Dec 2024 23:57:47 -0800 Subject: [PATCH] Fix third instance of regex --- server/scanner/AudioFileScanner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/scanner/AudioFileScanner.js b/server/scanner/AudioFileScanner.js index 3c364c1066..6c808aaa1c 100644 --- a/server/scanner/AudioFileScanner.js +++ b/server/scanner/AudioFileScanner.js @@ -133,8 +133,8 @@ class AudioFileScanner { // Look for disc number in folder path e.g. /Book Title/CD01/audiofile.mp3 const pathdir = Path.dirname(path).split('/').pop() - if (pathdir && /^cd\d{1,3}$/i.test(pathdir)) { - const discFromFolder = Number(pathdir.replace(/cd/i, '')) + if (pathdir && /^(cd|dis[ck])\s*\d{1,3}$/i.test(pathdir)) { + const discFromFolder = Number(pathdir.replace(/^(cd|dis[ck])\s*/i, '')) if (!isNaN(discFromFolder) && discFromFolder !== null) discNumber = discFromFolder }