From 739e99c4d9e13e43c0b21f468bb34aa9b3f7d8e8 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 17 Dec 2020 22:49:29 +0100 Subject: [PATCH] lib/config: Remove deprecated pending entries from config (ref #6443) (#7204) --- lib/config/config.go | 2 +- lib/config/migrations.go | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/config/config.go b/lib/config/config.go index fe160325c..8cab094a1 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -30,7 +30,7 @@ import ( const ( OldestHandledVersion = 10 - CurrentVersion = 32 + CurrentVersion = 33 MaxRescanIntervalS = 365 * 24 * 60 * 60 ) diff --git a/lib/config/migrations.go b/lib/config/migrations.go index 09a23658d..df12e9e0b 100644 --- a/lib/config/migrations.go +++ b/lib/config/migrations.go @@ -27,6 +27,7 @@ import ( // put the newest on top for readability. var ( migrations = migrationSet{ + {33, migrateToConfigV33}, {32, migrateToConfigV32}, {31, migrateToConfigV31}, {30, migrateToConfigV30}, @@ -91,9 +92,11 @@ func (m migration) apply(cfg *Configuration) { cfg.Version = m.targetVersion } -func migrateToConfigV31(cfg *Configuration) { - // Show a notification about setting User and Password - cfg.Options.UnackedNotificationIDs = append(cfg.Options.UnackedNotificationIDs, "authenticationUserAndPassword") +func migrateToConfigV33(cfg *Configuration) { + for i := range cfg.Devices { + cfg.Devices[i].DeprecatedPendingFolders = nil + } + cfg.DeprecatedPendingDevices = nil } 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) { // The "max concurrent scans" option is now spelled "max folder concurrency" // to be more general.