Bump Syncthing 0.14.38
[src/xds/xds-server.git] / lib / syncthing / stfolder.go
index bbdcc43..5c570a5 100644 (file)
@@ -32,9 +32,9 @@ func (s *SyncThing) FolderLoadFromStConfig(f *[]folder.FolderConfig) error {
        }
 
        for _, stFld := range stCfg.Folders {
-               cliPath := strings.TrimPrefix(stFld.RawPath, s.conf.FileConf.ShareRootDir)
+               cliPath := strings.TrimPrefix(stFld.Path, s.conf.FileConf.ShareRootDir)
                if cliPath == "" {
-                       cliPath = stFld.RawPath
+                       cliPath = stFld.Path
                }
                *f = append(*f, folder.FolderConfig{
                        ID:            stFld.ID,
@@ -96,9 +96,9 @@ func (s *SyncThing) FolderChange(f folder.FolderConfig) (string, error) {
        }
 
        folder := config.FolderConfiguration{
-               ID:      id,
-               Label:   label,
-               RawPath: filepath.Join(s.conf.FileConf.ShareRootDir, f.ClientPath),
+               ID:    id,
+               Label: label,
+               Path:  filepath.Join(s.conf.FileConf.ShareRootDir, f.ClientPath),
        }
 
        if s.conf.FileConf.SThgConf.RescanIntervalS > 0 {
@@ -191,13 +191,11 @@ func (s *SyncThing) FolderStatus(folderID string) (*FolderStatus, error) {
 
 // IsFolderInSync Returns true when folder is in sync
 func (s *SyncThing) IsFolderInSync(folderID string) (bool, error) {
-       // FIXME better to detected FolderCompletion event (/rest/events)
-       // See https://docs.syncthing.net/dev/events.html
        sts, err := s.FolderStatus(folderID)
        if err != nil {
                return false, err
        }
-       return sts.NeedBytes == 0, nil
+       return sts.NeedBytes == 0 && sts.State == "idle", nil
 }
 
 // FolderScan Request immediate folder scan.