mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 09:44:41 +02:00
Fix scan for audiobook directories in root dir
This commit is contained in:
parent
5ecfaa88c2
commit
a93f409dcd
11 changed files with 157 additions and 11 deletions
|
@ -39,13 +39,15 @@ async function getAllAudiobookFiles(abRootPath) {
|
|||
var pathformat = Path.parse(relpath)
|
||||
var path = pathformat.dir
|
||||
|
||||
// If relative file directory has 3 folders, then the middle folder will be series
|
||||
var splitDir = pathformat.dir.split(Path.sep)
|
||||
if (splitDir.length === 1) {
|
||||
Logger.error('Invalid file in root dir', filepath)
|
||||
if (!path) {
|
||||
Logger.error('Ignoring file in root dir', filepath)
|
||||
return
|
||||
}
|
||||
var author = splitDir.shift()
|
||||
|
||||
// If relative file directory has 3 folders, then the middle folder will be series
|
||||
var splitDir = pathformat.dir.split(Path.sep)
|
||||
var author = null
|
||||
if (splitDir.length > 1) author = splitDir.shift()
|
||||
var series = null
|
||||
if (splitDir.length > 1) series = splitDir.shift()
|
||||
var title = splitDir.shift()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue