Skip to content

Commit

Permalink
Fix third instance of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Techwolfy committed Dec 2, 2024
1 parent cc89db0 commit 605bd73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/scanner/AudioFileScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 605bd73

Please sign in to comment.