Update abmetadata file for new data model, add chapter and description section parser

This commit is contained in:
advplyr 2022-04-12 16:05:16 -05:00
parent 642e9787c0
commit 10d9e11387
12 changed files with 439 additions and 73 deletions

View file

@ -5,7 +5,7 @@ class ScanOptions {
// Server settings
this.parseSubtitles = false
this.findCovers = false
this.storeCoverWithBook = false
this.storeCoverWithItem = false
this.preferAudioMetadata = false
this.preferOpfMetadata = false
@ -30,7 +30,7 @@ class ScanOptions {
metadataPrecedence: this.metadataPrecedence,
parseSubtitles: this.parseSubtitles,
findCovers: this.findCovers,
storeCoverWithBook: this.storeCoverWithBook,
storeCoverWithItem: this.storeCoverWithItem,
preferAudioMetadata: this.preferAudioMetadata,
preferOpfMetadata: this.preferOpfMetadata
}
@ -41,7 +41,7 @@ class ScanOptions {
this.parseSubtitles = !!serverSettings.scannerParseSubtitle
this.findCovers = !!serverSettings.scannerFindCovers
this.storeCoverWithBook = serverSettings.storeCoverWithBook
this.storeCoverWithItem = serverSettings.storeCoverWithItem
this.preferAudioMetadata = serverSettings.scannerPreferAudioMetadata
this.preferOpfMetadata = serverSettings.scannerPreferOpfMetadata
}

View file

@ -413,6 +413,8 @@ class Scanner {
return libraryItem
}
// Any series or author object on library item with an id starting with "new"
// will create a new author/series OR find a matching author/series
async createNewAuthorsAndSeries(libraryItem) {
if (libraryItem.mediaType !== 'book') return
@ -422,11 +424,12 @@ class Scanner {
libraryItem.media.metadata.authors = libraryItem.media.metadata.authors.map((tempMinAuthor) => {
var _author = this.db.authors.find(au => au.checkNameEquals(tempMinAuthor.name))
if (!_author) _author = newAuthors.find(au => au.checkNameEquals(tempMinAuthor.name)) // Check new unsaved authors
if (!_author) {
if (!_author) { // Must create new author
_author = new Author()
_author.setData(tempMinAuthor)
newAuthors.push(_author)
}
return {
id: _author.id,
name: _author.name
@ -442,7 +445,7 @@ class Scanner {
libraryItem.media.metadata.series = libraryItem.media.metadata.series.map((tempMinSeries) => {
var _series = this.db.series.find(se => se.checkNameEquals(tempMinSeries.name))
if (!_series) _series = newSeries.find(se => se.checkNameEquals(tempMinSeries.name)) // Check new unsaved series
if (!_series) {
if (!_series) { // Must create new series
_series = new Series()
_series.setData(tempMinSeries)
newSeries.push(_series)