2021-11-23 02:58:20 +01:00
|
|
|
class ScanOptions {
|
2023-06-10 19:46:57 +02:00
|
|
|
constructor() {
|
2021-11-23 02:58:20 +01:00
|
|
|
this.forceRescan = false
|
|
|
|
|
|
|
|
// Server settings
|
|
|
|
this.parseSubtitles = false
|
|
|
|
this.findCovers = false
|
2022-04-12 23:05:16 +02:00
|
|
|
this.storeCoverWithItem = false
|
2021-11-25 03:15:50 +01:00
|
|
|
this.preferAudioMetadata = false
|
|
|
|
this.preferOpfMetadata = false
|
2022-05-23 04:56:51 +02:00
|
|
|
this.preferMatchedMetadata = false
|
2022-06-12 08:17:22 +02:00
|
|
|
this.preferOverdriveMediaMarker = false
|
2021-11-23 02:58:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
toJSON() {
|
|
|
|
return {
|
|
|
|
forceRescan: this.forceRescan,
|
|
|
|
parseSubtitles: this.parseSubtitles,
|
|
|
|
findCovers: this.findCovers,
|
2022-04-12 23:05:16 +02:00
|
|
|
storeCoverWithItem: this.storeCoverWithItem,
|
2021-11-25 03:15:50 +01:00
|
|
|
preferAudioMetadata: this.preferAudioMetadata,
|
2022-05-23 04:56:51 +02:00
|
|
|
preferOpfMetadata: this.preferOpfMetadata,
|
2022-06-12 08:17:22 +02:00
|
|
|
preferMatchedMetadata: this.preferMatchedMetadata,
|
|
|
|
preferOverdriveMediaMarker: this.preferOverdriveMediaMarker
|
2021-11-23 02:58:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setData(options, serverSettings) {
|
|
|
|
this.forceRescan = !!options.forceRescan
|
|
|
|
|
|
|
|
this.parseSubtitles = !!serverSettings.scannerParseSubtitle
|
|
|
|
this.findCovers = !!serverSettings.scannerFindCovers
|
2022-04-12 23:05:16 +02:00
|
|
|
this.storeCoverWithItem = serverSettings.storeCoverWithItem
|
2021-11-25 03:15:50 +01:00
|
|
|
this.preferAudioMetadata = serverSettings.scannerPreferAudioMetadata
|
|
|
|
this.preferOpfMetadata = serverSettings.scannerPreferOpfMetadata
|
2022-05-24 02:29:43 +02:00
|
|
|
this.scannerPreferMatchedMetadata = serverSettings.scannerPreferMatchedMetadata
|
2022-06-12 08:17:22 +02:00
|
|
|
this.preferOverdriveMediaMarker = serverSettings.scannerPreferOverdriveMediaMarker
|
2021-11-23 02:58:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = ScanOptions
|