lib/config: Remove deprecated pending entries from config (ref #6443) (#7204)

This commit is contained in:
Simon Frei 2020-12-17 22:49:29 +01:00 committed by GitHub
parent 7502997e7e
commit 739e99c4d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -30,7 +30,7 @@ import (
const ( const (
OldestHandledVersion = 10 OldestHandledVersion = 10
CurrentVersion = 32 CurrentVersion = 33
MaxRescanIntervalS = 365 * 24 * 60 * 60 MaxRescanIntervalS = 365 * 24 * 60 * 60
) )

View File

@ -27,6 +27,7 @@ import (
// put the newest on top for readability. // put the newest on top for readability.
var ( var (
migrations = migrationSet{ migrations = migrationSet{
{33, migrateToConfigV33},
{32, migrateToConfigV32}, {32, migrateToConfigV32},
{31, migrateToConfigV31}, {31, migrateToConfigV31},
{30, migrateToConfigV30}, {30, migrateToConfigV30},
@ -91,9 +92,11 @@ func (m migration) apply(cfg *Configuration) {
cfg.Version = m.targetVersion cfg.Version = m.targetVersion
} }
func migrateToConfigV31(cfg *Configuration) { func migrateToConfigV33(cfg *Configuration) {
// Show a notification about setting User and Password for i := range cfg.Devices {
cfg.Options.UnackedNotificationIDs = append(cfg.Options.UnackedNotificationIDs, "authenticationUserAndPassword") cfg.Devices[i].DeprecatedPendingFolders = nil
}
cfg.DeprecatedPendingDevices = nil
} }
func migrateToConfigV32(cfg *Configuration) { func migrateToConfigV32(cfg *Configuration) {
@ -102,6 +105,11 @@ func migrateToConfigV32(cfg *Configuration) {
} }
} }
func migrateToConfigV31(cfg *Configuration) {
// Show a notification about setting User and Password
cfg.Options.UnackedNotificationIDs = append(cfg.Options.UnackedNotificationIDs, "authenticationUserAndPassword")
}
func migrateToConfigV30(cfg *Configuration) { func migrateToConfigV30(cfg *Configuration) {
// The "max concurrent scans" option is now spelled "max folder concurrency" // The "max concurrent scans" option is now spelled "max folder concurrency"
// to be more general. // to be more general.