mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Add options to skip matching media items if they already have an ASIN/ISBN
This commit is contained in:
parent
d8ec3bd218
commit
84dd06dfc4
@ -93,7 +93,9 @@ export default {
|
|||||||
icon: 'database',
|
icon: 'database',
|
||||||
mediaType: 'book',
|
mediaType: 'book',
|
||||||
settings: {
|
settings: {
|
||||||
disableWatcher: false
|
disableWatcher: false,
|
||||||
|
skipMatchingMediaWithAsin: false,
|
||||||
|
skipMatchingMediaWithIsbn: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<p v-if="globalWatcherDisabled" class="text-xs text-warning">*Watcher is disabled globally in server settings</p>
|
<p v-if="globalWatcherDisabled" class="text-xs text-warning">*Watcher is disabled globally in server settings</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="py-3">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<ui-toggle-switch v-model="skipMatchingMediaWithAsin" @input="formUpdated" />
|
||||||
|
<p class="pl-4 text-lg">Skip matching books that already have an ASIN</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="py-3">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<ui-toggle-switch v-model="skipMatchingMediaWithIsbn" @input="formUpdated" />
|
||||||
|
<p class="pl-4 text-lg">Skip matching books that already have an ISBN</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -23,7 +35,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
provider: null,
|
provider: null,
|
||||||
disableWatcher: false
|
disableWatcher: false,
|
||||||
|
skipMatchingMediaWithAsin: false,
|
||||||
|
skipMatchingMediaWithIsbn: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -45,7 +59,9 @@ export default {
|
|||||||
getLibraryData() {
|
getLibraryData() {
|
||||||
return {
|
return {
|
||||||
settings: {
|
settings: {
|
||||||
disableWatcher: !!this.disableWatcher
|
disableWatcher: !!this.disableWatcher,
|
||||||
|
skipMatchingMediaWithAsin: !!this.skipMatchingMediaWithAsin,
|
||||||
|
skipMatchingMediaWithIsbn: !!this.skipMatchingMediaWithIsbn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -54,6 +70,8 @@ export default {
|
|||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.disableWatcher = !!this.librarySettings.disableWatcher
|
this.disableWatcher = !!this.librarySettings.disableWatcher
|
||||||
|
this.skipMatchingMediaWithAsin = !!this.librarySettings.skipMatchingMediaWithAsin
|
||||||
|
this.skipMatchingMediaWithIsbn = !!this.librarySettings.skipMatchingMediaWithIsbn
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -4,6 +4,8 @@ const Logger = require('../../Logger')
|
|||||||
class LibrarySettings {
|
class LibrarySettings {
|
||||||
constructor(settings) {
|
constructor(settings) {
|
||||||
this.disableWatcher = false
|
this.disableWatcher = false
|
||||||
|
this.skipMatchingMediaWithAsin = false
|
||||||
|
this.skipMatchingMediaWithIsbn = false
|
||||||
|
|
||||||
if (settings) {
|
if (settings) {
|
||||||
this.construct(settings)
|
this.construct(settings)
|
||||||
@ -12,11 +14,15 @@ class LibrarySettings {
|
|||||||
|
|
||||||
construct(settings) {
|
construct(settings) {
|
||||||
this.disableWatcher = !!settings.disableWatcher
|
this.disableWatcher = !!settings.disableWatcher
|
||||||
|
this.skipMatchingMediaWithAsin = !!settings.skipMatchingMediaWithAsin
|
||||||
|
this.skipMatchingMediaWithIsbn = !!settings.skipMatchingMediaWithIsbn
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
disableWatcher: this.disableWatcher
|
disableWatcher: this.disableWatcher,
|
||||||
|
skipMatchingMediaWithAsin: this.skipMatchingMediaWithAsin,
|
||||||
|
skipMatchingMediaWithIsbn: this.skipMatchingMediaWithIsbn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -726,6 +726,21 @@ class Scanner {
|
|||||||
|
|
||||||
for (let i = 0; i < itemsInLibrary.length; i++) {
|
for (let i = 0; i < itemsInLibrary.length; i++) {
|
||||||
var libraryItem = itemsInLibrary[i]
|
var libraryItem = itemsInLibrary[i]
|
||||||
|
|
||||||
|
if (libraryItem.media.metadata.asin && library.settings.skipMatchingMediaWithAsin) {
|
||||||
|
Logger.debug(`[Scanner] matchLibraryItems: Skipping "${
|
||||||
|
libraryItem.media.metadata.title
|
||||||
|
}" because it already has an ASIN (${i + 1} of ${itemsInLibrary.length})`)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (libraryItem.media.metadata.isbn && library.settings.skipMatchingMediaWithIsbn) {
|
||||||
|
Logger.debug(`[Scanner] matchLibraryItems: Skipping "${
|
||||||
|
libraryItem.media.metadata.title
|
||||||
|
}" because it already has an ISBN (${i + 1} of ${itemsInLibrary.length})`)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.debug(`[Scanner] matchLibraryItems: Quick matching "${libraryItem.media.metadata.title}" (${i + 1} of ${itemsInLibrary.length})`)
|
Logger.debug(`[Scanner] matchLibraryItems: Quick matching "${libraryItem.media.metadata.title}" (${i + 1} of ${itemsInLibrary.length})`)
|
||||||
var result = await this.quickMatchLibraryItem(libraryItem, { provider })
|
var result = await this.quickMatchLibraryItem(libraryItem, { provider })
|
||||||
if (result.warning) {
|
if (result.warning) {
|
||||||
|
Loading…
Reference in New Issue
Block a user