Clean and parse author name from directory, sort by author last name, scan for covers

This commit is contained in:
Mark Cooper 2021-08-24 20:24:40 -05:00
parent 9300a0bfb6
commit e230cb47e8
28 changed files with 783 additions and 59 deletions

View file

@ -1,6 +1,7 @@
const Path = require('path')
const dir = require('node-dir')
const Logger = require('../Logger')
const parseAuthors = require('./parseAuthors')
const { cleanString } = require('./index')
const AUDIOBOOK_PARTS_FORMATS = ['m4b', 'mp3']
@ -74,6 +75,14 @@ async function getAllAudiobookFiles(abRootPath) {
parts: [],
otherFiles: []
}
if (author) {
var parsedAuthors = parseAuthors(author)
if (parsedAuthors) {
var { authorLF, authorFL } = parsedAuthors
audiobooks[path].authorLF = authorLF || null
audiobooks[path].authorFL = authorFL || null
}
}
}
var filetype = getFileType(pathformat.ext)