mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-09 21:39:37 +00:00
Migrate to new library item in scanner
This commit is contained in:
parent
fdbca4feb6
commit
d5ce7b4939
21 changed files with 435 additions and 845 deletions
|
|
@ -401,23 +401,6 @@ class Database {
|
|||
return this.models.setting.updateSettingObj(settings.toJSON())
|
||||
}
|
||||
|
||||
/**
|
||||
* Save metadata file and update library item
|
||||
*
|
||||
* @param {import('./objects/LibraryItem')} oldLibraryItem
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async updateLibraryItem(oldLibraryItem) {
|
||||
if (!this.sequelize) return false
|
||||
await oldLibraryItem.saveMetadata()
|
||||
const updated = await this.models.libraryItem.fullUpdateFromOld(oldLibraryItem)
|
||||
// Clear library filter data cache
|
||||
if (updated) {
|
||||
delete this.libraryFilterData[oldLibraryItem.libraryId]
|
||||
}
|
||||
return updated
|
||||
}
|
||||
|
||||
getPlaybackSessions(where = null) {
|
||||
if (!this.sequelize) return false
|
||||
return this.models.playbackSession.getOldPlaybackSessions(where)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue