Auto checks Spotify state, re-backup and apply if needed, then launch Spotify client normally.
(spicetifyVersion string)
| 10 | // Auto checks Spotify state, re-backup and apply if needed, then launch |
| 11 | // Spotify client normally. |
| 12 | func Auto(spicetifyVersion string) { |
| 13 | backupVersion := backupSection.Key("version").MustString("") |
| 14 | spotStat := spotifystatus.Get(appPath) |
| 15 | backStat := backupstatus.Get(prefsPath, backupFolder, backupVersion) |
| 16 | |
| 17 | if spotStat.IsBackupable() && (backStat.IsEmpty() || backStat.IsOutdated()) { |
| 18 | Backup(spicetifyVersion, true) |
| 19 | backupVersion := backupSection.Key("version").MustString("") |
| 20 | backStat = backupstatus.Get(prefsPath, backupFolder, backupVersion) |
| 21 | } |
| 22 | |
| 23 | if !backStat.IsBackuped() { |
| 24 | os.Exit(1) |
| 25 | } |
| 26 | |
| 27 | if isAppX { |
| 28 | spotStat = spotifystatus.Get(appDestPath) |
| 29 | } |
| 30 | |
| 31 | if !spotStat.IsApplied() && backStat.IsBackuped() { |
| 32 | CheckStates() |
| 33 | InitSetting() |
| 34 | Apply(spicetifyVersion) |
| 35 | } |
| 36 | } |
no test coverage detected