"inotify", "Inot", "pname", "pkill", "sdkid", "CLOUDSYNC", "xdsagent",
"gdbserver", "golib", "eows", "mfolders", "IFOLDER", "flds", "dflt",
"stconfig", "reflectme", "franciscocpg", "crosssdk", "urfave", "EXEPATH",
- "conv", "Sillyf"
+ "conv", "Sillyf", "xsapiv"
]
}
"github.com/franciscocpg/reflectme"
common "github.com/iotbzh/xds-common/golib"
- "github.com/iotbzh/xds-server/lib/xsapiv1"
"github.com/iotbzh/xds-server/lib/xdsconfig"
+ "github.com/iotbzh/xds-server/lib/xsapiv1"
"github.com/syncthing/syncthing/lib/sync"
)
// Use XML format and not json to be able to save/load all fields including
// ones that are masked in json (IOW defined with `json:"-"`)
type xmlFolders struct {
- XMLName xml.Name `xml:"folders"`
- Version string `xml:"version,attr"`
+ XMLName xml.Name `xml:"folders"`
+ Version string `xml:"version,attr"`
Folders []xsapiv1.FolderConfig `xml:"folders"`
}
data := xmlFolders{}
err = xml.NewDecoder(fd).Decode(&data)
if err == nil {
+ // Decode old type encoding (number) for backward compatibility
+ for i, d := range data.Folders {
+ switch d.Type {
+ case "1":
+ data.Folders[i].Type = xsapiv1.TypePathMap
+ case "2":
+ data.Folders[i].Type = xsapiv1.TypeCloudSync
+ case "3":
+ data.Folders[i].Type = xsapiv1.TypeCifsSmb
+ }
+ }
+
*folders = data.Folders
}
return err