Add:Support for book folders with CD# subfolders #393

This commit is contained in:
advplyr 2022-03-07 16:22:20 -06:00
parent c6eb1096e8
commit 2b7f53b0a7
2 changed files with 16 additions and 2 deletions

View file

@ -47,6 +47,9 @@ function groupFilesIntoAudiobookPaths(paths) {
} else if (!dirparts.length) { // This is the last directory, create group
audiobookGroup[_path] = [Path.basename(path)]
return
} else if (dirparts.length === 1 && /^cd\d{1,3}$/i.test(dirparts[0])) { // Next directory is the last and is a CD dir, create group
audiobookGroup[_path] = [Path.posix.join(dirparts[0], Path.basename(path))]
return
}
}
})
@ -88,6 +91,9 @@ function groupFileItemsIntoBooks(fileItems) {
} else if (!dirparts.length) { // This is the last directory, create group
audiobookGroup[_path] = [item.name]
return
} else if (dirparts.length === 1 && /^cd\d{1,3}$/i.test(dirparts[0])) { // Next directory is the last and is a CD dir, create group
audiobookGroup[_path] = [Path.posix.join(dirparts[0], item.name)]
return
}
}
})