mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-17 00:08:55 +01:00
Initialise the selected provider to the default for the library when the batch quick match is first opened or if the user has switched libraries.
This commit is contained in:
parent
9983fe7d66
commit
11e3cf4f19
@ -54,8 +54,10 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
processing: false,
|
processing: false,
|
||||||
|
isScrollable: false,
|
||||||
|
lastUsedLibrary: undefined,
|
||||||
options: {
|
options: {
|
||||||
provider: 'google',
|
provider: undefined,
|
||||||
overrideDetails: true,
|
overrideDetails: true,
|
||||||
overrideCover: true,
|
overrideCover: true,
|
||||||
overrideDefaults: true
|
overrideDefaults: true
|
||||||
@ -66,6 +68,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
show: {
|
||||||
|
handler(newVal) {
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
show: {
|
show: {
|
||||||
get() {
|
get() {
|
||||||
@ -90,9 +99,20 @@ export default {
|
|||||||
providers() {
|
providers() {
|
||||||
if (this.isPodcast) return this.$store.state.scanners.podcastProviders
|
if (this.isPodcast) return this.$store.state.scanners.podcastProviders
|
||||||
return this.$store.state.scanners.providers
|
return this.$store.state.scanners.providers
|
||||||
}
|
},
|
||||||
|
libraryProvider() {
|
||||||
|
return this.$store.getters['libraries/getLibraryProvider'](this.currentLibraryId) || 'google'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
init() {
|
||||||
|
// If we don't have a set provider (first open of dialog) or we've switched library, set
|
||||||
|
// the selected provider to the current library default provider
|
||||||
|
if (!this.options.provider || (this.options.lastUsedLibrary != this.currentLibraryId)) {
|
||||||
|
this.options.lastUsedLibrary = this.currentLibraryId
|
||||||
|
this.options.provider = this.libraryProvider;
|
||||||
|
}
|
||||||
|
},
|
||||||
doBatchQuickMatch() {
|
doBatchQuickMatch() {
|
||||||
if (!this.selectedBookIds.length) return
|
if (!this.selectedBookIds.length) return
|
||||||
if (this.processing) return
|
if (this.processing) return
|
||||||
|
Loading…
Reference in New Issue
Block a user