diff --git a/client/components/modals/edit-tabs/Match.vue b/client/components/modals/edit-tabs/Match.vue index f082bc48..65fb88c9 100644 --- a/client/components/modals/edit-tabs/Match.vue +++ b/client/components/modals/edit-tabs/Match.vue @@ -104,20 +104,6 @@ export default { searchTitle: null, searchAuthor: null, lastSearch: null, - providers: [ - { - text: 'Google Books', - value: 'google' - }, - { - text: 'Open Library', - value: 'openlibrary' - }, - { - text: 'Audible', - value: 'audible' - } - ], provider: 'google', searchResults: [], hasSearched: false, @@ -156,6 +142,9 @@ export default { }, bookCoverAspectRatio() { return this.$store.getters['getBookCoverAspectRatio'] + }, + providers() { + return this.$store.state.scanners.providers } }, methods: { diff --git a/client/pages/config/index.vue b/client/pages/config/index.vue index 79e69c81..a09fb046 100644 --- a/client/pages/config/index.vue +++ b/client/pages/config/index.vue @@ -7,34 +7,6 @@

Settings

-
- - -

Scanner parse subtitles info_outlined

-
-
- -
- - -

Scanner find covers info_outlined

-
-
- -
- - -

Scanner prefer audio metadata info_outlined

-
-
- -
- - -

Scanner prefer OPF metadata info_outlined

-
-
-
@@ -55,6 +27,42 @@

Use alternative library bookshelf view info_outlined

+ +
+

Scanner Settings

+
+ +
+ + +

Scanner parse subtitles info_outlined

+
+
+ +
+ + +

Scanner find covers info_outlined

+
+
+
+
+ +
+ +
+ + +

Scanner prefer audio metadata info_outlined

+
+
+ +
+ + +

Scanner prefer OPF metadata info_outlined

+
+
@@ -85,9 +93,9 @@
- @@ -145,6 +153,9 @@ export default { bookshelfViewTooltip() { return 'Alternative bookshelf view that shows title & author under book covers' }, + providers() { + return this.$store.state.scanners.providers + }, showExperimentalFeatures: { get() { return this.$store.state.showExperimentalFeatures @@ -160,6 +171,11 @@ export default { scannerFindCovers: !!val }) }, + updateScannerCoverProvider(val) { + this.updateServerSettings({ + scannerCoverProvider: val + }) + }, updateCoverStorageDestination(val) { this.newServerSettings.coverDestination = val ? this.$constants.CoverDestination.AUDIOBOOK : this.$constants.CoverDestination.METADATA this.updateServerSettings({ diff --git a/client/store/scanners.js b/client/store/scanners.js index 1a106332..8312e712 100644 --- a/client/store/scanners.js +++ b/client/store/scanners.js @@ -1,5 +1,19 @@ export const state = () => ({ - libraryScans: [] + libraryScans: [], + providers: [ + { + text: 'Google Books', + value: 'google' + }, + { + text: 'Open Library', + value: 'openlibrary' + }, + { + text: 'Audible', + value: 'audible' + } + ] }) export const getters = { diff --git a/server/objects/ServerSettings.js b/server/objects/ServerSettings.js index 3e13804b..34bacb6c 100644 --- a/server/objects/ServerSettings.js +++ b/server/objects/ServerSettings.js @@ -12,6 +12,7 @@ class ServerSettings { // Scanner this.scannerParseSubtitle = false this.scannerFindCovers = false + this.scannerCoverProvider = 'google' this.scannerPreferAudioMetadata = false this.scannerPreferOpfMetadata = false @@ -49,6 +50,7 @@ class ServerSettings { this.autoTagNew = settings.autoTagNew this.newTagExpireDays = settings.newTagExpireDays this.scannerFindCovers = !!settings.scannerFindCovers + this.scannerCoverProvider = settings.scannerCoverProvider || 'google' this.scannerParseSubtitle = settings.scannerParseSubtitle this.scannerPreferAudioMetadata = !!settings.scannerPreferAudioMetadata this.scannerPreferOpfMetadata = !!settings.scannerPreferOpfMetadata @@ -82,6 +84,7 @@ class ServerSettings { autoTagNew: this.autoTagNew, newTagExpireDays: this.newTagExpireDays, scannerFindCovers: this.scannerFindCovers, + scannerCoverProvider: this.scannerCoverProvider, scannerParseSubtitle: this.scannerParseSubtitle, scannerPreferAudioMetadata: this.scannerPreferAudioMetadata, scannerPreferOpfMetadata: this.scannerPreferOpfMetadata, diff --git a/server/scanner/Scanner.js b/server/scanner/Scanner.js index 177d5db0..8290c4c2 100644 --- a/server/scanner/Scanner.js +++ b/server/scanner/Scanner.js @@ -519,7 +519,8 @@ class Scanner { titleDistance: 2, authorDistance: 2 } - var results = await this.bookFinder.findCovers('google', audiobook.title, audiobook.authorFL, options) + var scannerCoverProvider = this.db.serverSettings.scannerCoverProvider + var results = await this.bookFinder.findCovers(scannerCoverProvider, audiobook.title, audiobook.authorFL, options) if (results.length) { if (libraryScan) libraryScan.addLog(LogLevel.DEBUG, `Found best cover for "${audiobook.title}"`) else Logger.debug(`[Scanner] Found best cover for "${audiobook.title}"`)