New data model scanner update and change scan chunks to be based on total file size

This commit is contained in:
advplyr 2022-03-18 09:16:10 -05:00
parent 14a8f84446
commit f00b120e96
6 changed files with 94 additions and 36 deletions

View file

@ -141,6 +141,11 @@ class LibraryItem {
this.libraryFiles.forEach((lf) => total += lf.metadata.size)
return total
}
get audioFileTotalSize() {
var total = 0
this.libraryFiles.filter(lf => lf.fileType == 'audio').forEach((lf) => total += lf.metadata.size)
return total
}
get hasAudioFiles() {
return this.libraryFiles.some(lf => lf.fileType === 'audio')
}
@ -347,7 +352,9 @@ class LibraryItem {
return true
})
if (filesRemoved.length) {
this.media.checkUpdateMissingTracks()
if (this.media.audiobooks && this.media.audiobooks.length) {
this.media.audiobooks.forEach(ab => ab.checkUpdateMissingTracks())
}
hasUpdated = true
}