mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
add getter to libraryscan.js for overdrivemediamarker
This commit is contained in:
parent
6064e8af87
commit
cbd7294b0b
@ -34,6 +34,7 @@ class LibraryScan {
|
|||||||
get forceRescan() { return !!this._scanOptions.forceRescan }
|
get forceRescan() { return !!this._scanOptions.forceRescan }
|
||||||
get preferAudioMetadata() { return !!this._scanOptions.preferAudioMetadata }
|
get preferAudioMetadata() { return !!this._scanOptions.preferAudioMetadata }
|
||||||
get preferOpfMetadata() { return !!this._scanOptions.preferOpfMetadata }
|
get preferOpfMetadata() { return !!this._scanOptions.preferOpfMetadata }
|
||||||
|
get preferOverdriveMediaMarker() { return !!this._scanOptions.preferOverdriveMediaMarker }
|
||||||
get findCovers() { return !!this._scanOptions.findCovers }
|
get findCovers() { return !!this._scanOptions.findCovers }
|
||||||
get timestamp() {
|
get timestamp() {
|
||||||
return (new Date()).toISOString()
|
return (new Date()).toISOString()
|
||||||
|
@ -315,8 +315,9 @@ class Scanner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async scanNewLibraryItemDataChunk(newLibraryItemsData, libraryScan) {
|
async scanNewLibraryItemDataChunk(newLibraryItemsData, libraryScan) {
|
||||||
|
Logger.debug(`LIBRARYSCAN: ${JSON.stringify(libraryScan)}`)
|
||||||
var newLibraryItems = await Promise.all(newLibraryItemsData.map((lid) => {
|
var newLibraryItems = await Promise.all(newLibraryItemsData.map((lid) => {
|
||||||
return this.scanNewLibraryItem(lid, libraryScan.libraryMediaType, libraryScan.preferAudioMetadata, libraryScan.preferOpfMetadata, libraryScan.findCovers, libraryScan.scanOptions.preferOverdriveMediaMarker, libraryScan)
|
return this.scanNewLibraryItem(lid, libraryScan.libraryMediaType, libraryScan.preferAudioMetadata, libraryScan.preferOpfMetadata, libraryScan.findCovers, libraryScan.preferOverdriveMediaMarker, libraryScan)
|
||||||
}))
|
}))
|
||||||
newLibraryItems = newLibraryItems.filter(li => li) // Filter out nulls
|
newLibraryItems = newLibraryItems.filter(li => li) // Filter out nulls
|
||||||
|
|
||||||
@ -343,10 +344,10 @@ class Scanner {
|
|||||||
// forceRescan all existing audio files - will probe and update ID3 tag metadata
|
// forceRescan all existing audio files - will probe and update ID3 tag metadata
|
||||||
var existingAudioFiles = existingLibraryFiles.filter(lf => lf.fileType === 'audio')
|
var existingAudioFiles = existingLibraryFiles.filter(lf => lf.fileType === 'audio')
|
||||||
if (libraryScan.scanOptions.forceRescan && existingAudioFiles.length) {
|
if (libraryScan.scanOptions.forceRescan && existingAudioFiles.length) {
|
||||||
Logger.debug(`[Scanner] // forceRescan all existing audio files -- this is libraryScan.preferOverdriveMediaMarker: ${libraryScan.scanOptions.preferOverdriveMediaMarker}`)
|
Logger.debug(`[Scanner] // forceRescan all existing audio files -- this is libraryScan.preferOverdriveMediaMarker: ${libraryScan.preferOverdriveMediaMarker}`)
|
||||||
Logger.debug(`[Scanner] // forceRescan all existing audio files -- this is libraryScan: ${JSON.stringify(libraryScan)}`)
|
Logger.debug(`[Scanner] // forceRescan all existing audio files -- this is libraryScan: ${JSON.stringify(libraryScan)}`)
|
||||||
|
|
||||||
if (await MediaFileScanner.scanMediaFiles(existingAudioFiles, scanData, libraryItem, libraryScan.preferAudioMetadata, libraryScan.scanOptions.preferOverdriveMediaMarker, libraryScan)) {
|
if (await MediaFileScanner.scanMediaFiles(existingAudioFiles, scanData, libraryItem, libraryScan.preferAudioMetadata, libraryScan.preferOverdriveMediaMarker, libraryScan)) {
|
||||||
hasUpdated = true
|
hasUpdated = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,8 +355,8 @@ class Scanner {
|
|||||||
var newAudioFiles = newLibraryFiles.filter(lf => lf.fileType === 'audio')
|
var newAudioFiles = newLibraryFiles.filter(lf => lf.fileType === 'audio')
|
||||||
var removedAudioFiles = filesRemoved.filter(lf => lf.fileType === 'audio')
|
var removedAudioFiles = filesRemoved.filter(lf => lf.fileType === 'audio')
|
||||||
if (newAudioFiles.length || removedAudioFiles.length) {
|
if (newAudioFiles.length || removedAudioFiles.length) {
|
||||||
Logger.debug(`[Scanner] // Scan new audio files -- this is libraryScan.preferOverdriveMediaMarker: ${libraryScan.scanOptions.preferOverdriveMediaMarker}`)
|
Logger.debug(`[Scanner] // Scan new audio files -- this is libraryScan.preferOverdriveMediaMarker: ${libraryScan.preferOverdriveMediaMarker}`)
|
||||||
if (await MediaFileScanner.scanMediaFiles(newAudioFiles, scanData, libraryItem, libraryScan.preferAudioMetadata, libraryScan.scanOptions.preferOverdriveMediaMarker, libraryScan)) {
|
if (await MediaFileScanner.scanMediaFiles(newAudioFiles, scanData, libraryItem, libraryScan.preferAudioMetadata, libraryScan.preferOverdriveMediaMarker, libraryScan)) {
|
||||||
hasUpdated = true
|
hasUpdated = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user