Fix: Scanner check path and inode value for removed books, scanner v5 outlined

This commit is contained in:
advplyr 2021-11-22 19:58:20 -06:00
parent ea366c00ca
commit 3fa0fe4b64
12 changed files with 553 additions and 7 deletions

View file

@ -0,0 +1,34 @@
const Folder = require('../objects/Folder')
const { getId } = require('../utils/index')
class LibraryScan {
constructor() {
this.id = null
this.libraryId = null
this.libraryName = null
this.folders = null
this.scanOptions = null
this.startedAt = null
this.finishedAt = null
this.folderScans = []
}
get _scanOptions() { return this.scanOptions || {} }
get forceRescan() { return !!this._scanOptions.forceRescan }
setData(library, scanOptions) {
this.id = getId('lscan')
this.libraryId = library.id
this.libraryName = library.name
this.folders = library.folders.map(folder => Folder(folder.toJSON()))
this.scanOptions = scanOptions
this.startedAt = Date.now()
}
}
module.exports = LibraryScan