Client: Use new server providers API

This commit is contained in:
mikiher 2025-10-15 09:52:15 +03:00
parent 1da3ab7fdc
commit ce4ff4f894
10 changed files with 90 additions and 124 deletions

View file

@ -371,11 +371,25 @@ export default {
},
customMetadataProviderAdded(provider) {
if (!provider?.id) return
this.$store.commit('scanners/addCustomMetadataProvider', provider)
// Refetch the appropriate provider types
if (provider.mediaType === 'book') {
this.$store.dispatch('scanners/fetchBookProviders')
this.$store.dispatch('scanners/fetchBookCoverProviders')
} else if (provider.mediaType === 'podcast') {
this.$store.dispatch('scanners/fetchPodcastProviders')
this.$store.dispatch('scanners/fetchPodcastCoverProviders')
}
},
customMetadataProviderRemoved(provider) {
if (!provider?.id) return
this.$store.commit('scanners/removeCustomMetadataProvider', provider)
// Refetch the appropriate provider types
if (provider.mediaType === 'book') {
this.$store.dispatch('scanners/fetchBookProviders')
this.$store.dispatch('scanners/fetchBookCoverProviders')
} else if (provider.mediaType === 'podcast') {
this.$store.dispatch('scanners/fetchPodcastProviders')
this.$store.dispatch('scanners/fetchPodcastCoverProviders')
}
},
initializeSocket() {
if (this.$root.socket) {
@ -612,6 +626,12 @@ export default {
this.$store.dispatch('libraries/load')
// Fetch metadata providers
this.$store.dispatch('scanners/fetchBookProviders')
this.$store.dispatch('scanners/fetchBookCoverProviders')
this.$store.dispatch('scanners/fetchPodcastProviders')
this.$store.dispatch('scanners/fetchPodcastCoverProviders')
this.initLocalStorage()
this.checkVersionUpdate()