mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Fix: initializing backup settings #146
This commit is contained in:
		
							parent
							
								
									c6614aba05
								
							
						
					
					
						commit
						6fbd9dc260
					
				| @ -31,12 +31,24 @@ export default { | |||||||
|     return { |     return { | ||||||
|       updatingServerSettings: false, |       updatingServerSettings: false, | ||||||
|       dailyBackups: true, |       dailyBackups: true, | ||||||
|       backupsToKeep: 2 |       backupsToKeep: 2, | ||||||
|  |       newServerSettings: {} | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   watch: { | ||||||
|  |     serverSettings(newVal, oldVal) { | ||||||
|  |       if (newVal && !oldVal) { | ||||||
|  |         this.newServerSettings = { ...this.serverSettings } | ||||||
|  |         this.initServerSettings() | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
|     dailyBackupsTooltip() { |     dailyBackupsTooltip() { | ||||||
|       return 'Runs at 1am every day (your server time). Saved in /metadata/backups.' |       return 'Runs at 1am every day (your server time). Saved in /metadata/backups.' | ||||||
|  |     }, | ||||||
|  |     serverSettings() { | ||||||
|  |       return this.$store.state.serverSettings | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
| @ -63,8 +75,16 @@ export default { | |||||||
|           console.error('Failed to update server settings', error) |           console.error('Failed to update server settings', error) | ||||||
|           this.updatingServerSettings = false |           this.updatingServerSettings = false | ||||||
|         }) |         }) | ||||||
|  |     }, | ||||||
|  |     initServerSettings() { | ||||||
|  |       this.newServerSettings = this.serverSettings ? { ...this.serverSettings } : {} | ||||||
|  | 
 | ||||||
|  |       this.backupsToKeep = this.newServerSettings.backupsToKeep || 2 | ||||||
|  |       this.dailyBackups = !!this.newServerSettings.backupSchedule | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   mounted() {} |   mounted() { | ||||||
|  |     this.initServerSettings() | ||||||
|  |   } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| @ -145,8 +145,6 @@ export default { | |||||||
| 
 | 
 | ||||||
|       this.storeCoversInAudiobookDir = this.newServerSettings.coverDestination === this.$constants.CoverDestination.AUDIOBOOK |       this.storeCoversInAudiobookDir = this.newServerSettings.coverDestination === this.$constants.CoverDestination.AUDIOBOOK | ||||||
|       this.storeCoversInAudiobookDir = this.newServerSettings.coverDestination === this.$constants.CoverDestination.AUDIOBOOK |       this.storeCoversInAudiobookDir = this.newServerSettings.coverDestination === this.$constants.CoverDestination.AUDIOBOOK | ||||||
|       this.backupsToKeep = this.newServerSettings.backupsToKeep || 2 |  | ||||||
|       this.dailyBackups = !!this.newServerSettings.backupSchedule |  | ||||||
|     }, |     }, | ||||||
|     resetAudiobooks() { |     resetAudiobooks() { | ||||||
|       if (confirm('WARNING! This action will remove all audiobooks from the database including any updates or matches you have made. This does not do anything to your actual files. Shall we continue?')) { |       if (confirm('WARNING! This action will remove all audiobooks from the database including any updates or matches you have made. This does not do anything to your actual files. Shall we continue?')) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user