mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-01 08:44:40 +02:00
New data model removing media entity for books
This commit is contained in:
parent
920ca683b9
commit
3150822117
44 changed files with 733 additions and 798 deletions
|
@ -358,8 +358,8 @@ class LibraryItem {
|
|||
return true
|
||||
})
|
||||
if (filesRemoved.length) {
|
||||
if (this.media.audiobooks && this.media.audiobooks.length) {
|
||||
this.media.audiobooks.forEach(ab => ab.checkUpdateMissingTracks())
|
||||
if (this.media.mediaType === 'book') {
|
||||
this.media.checkUpdateMissingTracks()
|
||||
}
|
||||
hasUpdated = true
|
||||
}
|
||||
|
@ -404,17 +404,14 @@ class LibraryItem {
|
|||
var hasUpdated = false
|
||||
|
||||
if (this.mediaType === 'book') {
|
||||
// Add/update ebook files (ebooks that were removed are removed in checkScanData)
|
||||
// Add/update ebook file (ebooks that were removed are removed in checkScanData)
|
||||
this.libraryFiles.forEach((lf) => {
|
||||
if (lf.fileType === 'ebook') {
|
||||
var existingFile = this.media.findFileWithInode(lf.ino)
|
||||
if (!existingFile) {
|
||||
this.media.addEbookFile(lf)
|
||||
if (!this.media.ebookFile) {
|
||||
this.media.setEbookFile(lf)
|
||||
hasUpdated = true
|
||||
} else if (this.media.ebookFile.ino == lf.ino && this.media.ebookFile.updateFromLibraryFile(lf)) { // Update existing ebookFile
|
||||
hasUpdated = true
|
||||
} else if (existingFile.ebookFormat) {
|
||||
if (existingFile.updateFromLibraryFile(lf)) {// EBookFile.js
|
||||
hasUpdated = true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -447,8 +444,8 @@ class LibraryItem {
|
|||
return this.media.searchQuery(query)
|
||||
}
|
||||
|
||||
getPlaybackMediaEntity() {
|
||||
return this.media.getPlaybackMediaEntity()
|
||||
getDirectPlayTracklist(libraryItemId) {
|
||||
return this.media.getDirectPlayTracklist(libraryItemId)
|
||||
}
|
||||
}
|
||||
module.exports = LibraryItem
|
Loading…
Add table
Add a link
Reference in a new issue