浏览代码

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

Simon Frei 4 年之前
父节点
当前提交
739e99c4d9
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 1 1
      lib/config/config.go
  2. 11 3
      lib/config/migrations.go

+ 1 - 1
lib/config/config.go

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

+ 11 - 3
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.