Narrator data is sucessfully saved from folder name.

This commit is contained in:
Cassie Esposito 2022-05-19 20:43:17 -07:00
parent efdb43e2d2
commit 23904d57ad
2 changed files with 6 additions and 2 deletions

View File

@ -194,7 +194,7 @@ class BookMetadata {
setData(scanMediaData = {}) { setData(scanMediaData = {}) {
this.title = scanMediaData.title || null this.title = scanMediaData.title || null
this.subtitle = scanMediaData.subtitle || null this.subtitle = scanMediaData.subtitle || null
this.narrators = [] this.narrators = this.parseNarratorsTag(scanMediaData.narrators)
this.publishedYear = scanMediaData.publishedYear || null this.publishedYear = scanMediaData.publishedYear || null
this.description = scanMediaData.description || null this.description = scanMediaData.description || null
this.isbn = scanMediaData.isbn || null this.isbn = scanMediaData.isbn || null

View File

@ -215,6 +215,9 @@ function getBookDataFromDir(folderPath, relPath, parseSubtitle = false) {
// Audio files will always be in the directory named for the title // Audio files will always be in the directory named for the title
var [title, narrators] = getTitleAndNarrator(splitDir.pop()) var [title, narrators] = getTitleAndNarrator(splitDir.pop())
const parseNameString = require('./parseNameString')
console.log(`\n\n\n${JSON.stringify(parseNameString.parse(narrators), 0, 2)}\n\n\n`)
var series = null var series = null
var author = null var author = null
// If there are at least 2 more directories, next furthest will be the series // If there are at least 2 more directories, next furthest will be the series
@ -294,6 +297,7 @@ function getBookDataFromDir(folderPath, relPath, parseSubtitle = false) {
series, series,
sequence: volumeNumber, sequence: volumeNumber,
publishedYear, publishedYear,
narrators,
}, },
relPath: relPath, // relative audiobook path i.e. /Author Name/Book Name/.. relPath: relPath, // relative audiobook path i.e. /Author Name/Book Name/..
path: Path.posix.join(folderPath, relPath) // i.e. /audiobook/Author Name/Book Name/.. path: Path.posix.join(folderPath, relPath) // i.e. /audiobook/Author Name/Book Name/..