Updates to LibraryItemController to use new model

This commit is contained in:
advplyr 2025-01-02 15:42:52 -06:00
parent dd0ebdf2d8
commit 4787e7fdb5
8 changed files with 245 additions and 195 deletions

View file

@ -327,20 +327,5 @@ class LibraryItem {
}
return false
}
/**
* Set the EBookFile from a LibraryFile
* If null then ebookFile will be removed from the book
* all ebook library files that are not primary are marked as supplementary
*
* @param {LibraryFile} [libraryFile]
*/
setPrimaryEbook(ebookLibraryFile = null) {
const ebookLibraryFiles = this.libraryFiles.filter((lf) => lf.isEBookFile)
for (const libraryFile of ebookLibraryFiles) {
libraryFile.isSupplementary = ebookLibraryFile?.ino !== libraryFile.ino
}
this.media.setEbookFile(ebookLibraryFile)
}
}
module.exports = LibraryItem