mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Fix:Library scan toasts
This commit is contained in:
		
							parent
							
								
									85946dd1d5
								
							
						
					
					
						commit
						228d9cc301
					
				| @ -190,7 +190,15 @@ export default { | |||||||
|     }, |     }, | ||||||
|     settingsUpdated(settings) {}, |     settingsUpdated(settings) {}, | ||||||
|     scan() { |     scan() { | ||||||
|       this.$store.dispatch('libraries/requestLibraryScan', { libraryId: this.$store.state.libraries.currentLibraryId }) |       this.$store | ||||||
|  |         .dispatch('libraries/requestLibraryScan', { libraryId: this.$store.state.libraries.currentLibraryId }) | ||||||
|  |         .then(() => { | ||||||
|  |           this.$toast.success('Library scan started') | ||||||
|  |         }) | ||||||
|  |         .catch((error) => { | ||||||
|  |           console.error('Failed to start scan', error) | ||||||
|  |           this.$toast.error('Failed to start scan') | ||||||
|  |         }) | ||||||
|     }, |     }, | ||||||
|     libraryItemAdded(libraryItem) { |     libraryItemAdded(libraryItem) { | ||||||
|       console.log('libraryItem added', libraryItem) |       console.log('libraryItem added', libraryItem) | ||||||
|  | |||||||
| @ -605,7 +605,15 @@ export default { | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     scan() { |     scan() { | ||||||
|       this.$store.dispatch('libraries/requestLibraryScan', { libraryId: this.currentLibraryId }) |       this.$store | ||||||
|  |         .dispatch('libraries/requestLibraryScan', { libraryId: this.currentLibraryId }) | ||||||
|  |         .then(() => { | ||||||
|  |           this.$toast.success('Library scan started') | ||||||
|  |         }) | ||||||
|  |         .catch((error) => { | ||||||
|  |           console.error('Failed to start scan', error) | ||||||
|  |           this.$toast.error('Failed to start scan') | ||||||
|  |         }) | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   mounted() { |   mounted() { | ||||||
|  | |||||||
| @ -73,10 +73,26 @@ export default { | |||||||
|       this.$emit('edit', this.library) |       this.$emit('edit', this.library) | ||||||
|     }, |     }, | ||||||
|     scan() { |     scan() { | ||||||
|       this.$store.dispatch('libraries/requestLibraryScan', { libraryId: this.library.id }) |       this.$store | ||||||
|  |         .dispatch('libraries/requestLibraryScan', { libraryId: this.library.id }) | ||||||
|  |         .then(() => { | ||||||
|  |           this.$toast.success('Library scan started') | ||||||
|  |         }) | ||||||
|  |         .catch((error) => { | ||||||
|  |           console.error('Failed to start scan', error) | ||||||
|  |           this.$toast.error('Failed to start scan') | ||||||
|  |         }) | ||||||
|     }, |     }, | ||||||
|     forceScan() { |     forceScan() { | ||||||
|       this.$store.dispatch('libraries/requestLibraryScan', { libraryId: this.library.id, force: 1 }) |       this.$store | ||||||
|  |         .dispatch('libraries/requestLibraryScan', { libraryId: this.library.id, force: 1 }) | ||||||
|  |         .then(() => { | ||||||
|  |           this.$toast.success('Library scan started') | ||||||
|  |         }) | ||||||
|  |         .catch((error) => { | ||||||
|  |           console.error('Failed to start scan', error) | ||||||
|  |           this.$toast.error('Failed to start scan') | ||||||
|  |         }) | ||||||
|     }, |     }, | ||||||
|     deleteClick() { |     deleteClick() { | ||||||
|       if (this.isMain) return |       if (this.isMain) return | ||||||
|  | |||||||
| @ -47,12 +47,7 @@ export const getters = { | |||||||
| 
 | 
 | ||||||
| export const actions = { | export const actions = { | ||||||
|   requestLibraryScan({ state, commit }, { libraryId, force }) { |   requestLibraryScan({ state, commit }, { libraryId, force }) { | ||||||
|     this.$axios.$get(`/api/libraries/${libraryId}/scan`, { params: { force } }).then(() => { |     return this.$axios.$get(`/api/libraries/${libraryId}/scan`, { params: { force } }) | ||||||
|       this.$toast.success('Library scan started') |  | ||||||
|     }).catch((error) => { |  | ||||||
|       console.error('Failed to start scan', error) |  | ||||||
|       this.$toast.error('Failed to start scan') |  | ||||||
|     }) |  | ||||||
|   }, |   }, | ||||||
|   loadFolders({ state, commit }) { |   loadFolders({ state, commit }) { | ||||||
|     if (state.folders.length) { |     if (state.folders.length) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user