mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-14 11:25:02 +02:00
New data model fix scan for creating series/authors and mapping ebooks
This commit is contained in:
parent
ea9ec13845
commit
6597fca576
7 changed files with 134 additions and 50 deletions
|
@ -30,5 +30,28 @@ class EBookFile {
|
|||
updatedAt: this.updatedAt
|
||||
}
|
||||
}
|
||||
|
||||
setData(libraryFile) {
|
||||
this.ino = libraryFile.ino
|
||||
this.metadata = libraryFile.metadata.clone()
|
||||
this.ebookFormat = libraryFile.metadata.format
|
||||
this.addedAt = Date.now()
|
||||
this.updatedAt = Date.now()
|
||||
}
|
||||
|
||||
updateFromLibraryFile(libraryFile) {
|
||||
var hasUpdated = false
|
||||
|
||||
if (this.metadata.update(libraryFile.metadata)) {
|
||||
hasUpdated = true
|
||||
}
|
||||
|
||||
if (this.ebookFormat !== libraryFile.metadata.format) {
|
||||
this.ebookFormat = libraryFile.metadata.format
|
||||
hasUpdated = true
|
||||
}
|
||||
|
||||
return hasUpdated
|
||||
}
|
||||
}
|
||||
module.exports = EBookFile
|
Loading…
Add table
Add a link
Reference in a new issue