mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 19:01:41 +00:00
Updated to use new NotificationManager singleton.
This commit is contained in:
parent
a5ef1d4d0e
commit
9513580043
1 changed files with 6 additions and 6 deletions
|
|
@ -14,10 +14,10 @@ const LibraryItemScanner = require('./LibraryItemScanner')
|
|||
const LibraryScan = require('./LibraryScan')
|
||||
const LibraryItemScanData = require('./LibraryItemScanData')
|
||||
const Task = require('../objects/Task')
|
||||
const NotificationManager = require('../managers/NotificationManager')
|
||||
|
||||
class LibraryScanner {
|
||||
constructor(notificationManager) {
|
||||
this.notificationManager = notificationManager
|
||||
constructor() {
|
||||
this.cancelLibraryScan = {}
|
||||
/** @type {string[]} - library ids */
|
||||
this.librariesScanning = []
|
||||
|
|
@ -285,7 +285,7 @@ class LibraryScanner {
|
|||
'items_added',
|
||||
newOldLibraryItems.map((li) => li.toJSONExpanded())
|
||||
)
|
||||
this.notificationManager.onItemsAdded(newOldLibraryItems)
|
||||
NotificationManager.onItemsAdded(newOldLibraryItems)
|
||||
newOldLibraryItems = []
|
||||
}
|
||||
|
||||
|
|
@ -298,7 +298,7 @@ class LibraryScanner {
|
|||
'items_added',
|
||||
newOldLibraryItems.map((li) => li.toJSONExpanded())
|
||||
)
|
||||
this.notificationManager.onItemsAdded(newOldLibraryItems)
|
||||
NotificationManager.onItemsAdded(newOldLibraryItems)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -650,7 +650,7 @@ class LibraryScanner {
|
|||
if (newLibraryItem) {
|
||||
const oldNewLibraryItem = Database.libraryItemModel.getOldLibraryItem(newLibraryItem)
|
||||
SocketAuthority.emitter('item_added', oldNewLibraryItem.toJSONExpanded())
|
||||
this.notificationManager.onItemsAdded([oldNewLibraryItem])
|
||||
NotificationManager.onItemsAdded([oldNewLibraryItem])
|
||||
}
|
||||
itemGroupingResults[itemDir] = newLibraryItem ? ScanResult.ADDED : ScanResult.NOTHING
|
||||
}
|
||||
|
|
@ -658,7 +658,7 @@ class LibraryScanner {
|
|||
return itemGroupingResults
|
||||
}
|
||||
}
|
||||
module.exports = new LibraryScanner(new NotificationManager())
|
||||
module.exports = new LibraryScanner()
|
||||
|
||||
function ItemToFileInoMatch(libraryItem1, libraryItem2) {
|
||||
return libraryItem1.isFile && libraryItem2.libraryFiles.some((lf) => lf.ino === libraryItem1.ino)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue