X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fsyncthing%2Fstfolder.go;h=45ac60deb4e071bc92f647d30ca83d9cee01adbc;hb=2c9ae6a5a27ae2f2e23495c613e7a53aed8e786c;hp=d79e579eb6d4e2c5f022a83d5fe288ce14528802;hpb=51da3506a296b7d5d4185b17364f188292136888;p=src%2Fxds%2Fxds-server.git diff --git a/lib/syncthing/stfolder.go b/lib/syncthing/stfolder.go index d79e579..45ac60d 100644 --- a/lib/syncthing/stfolder.go +++ b/lib/syncthing/stfolder.go @@ -4,21 +4,13 @@ import ( "path/filepath" "strings" + "github.com/iotbzh/xds-server/lib/xdsconfig" "github.com/syncthing/syncthing/lib/config" "github.com/syncthing/syncthing/lib/protocol" ) -// FIXME remove and use an interface on xdsconfig.FolderConfig -type FolderChangeArg struct { - ID string - Label string - RelativePath string - SyncThingID string - ShareRootDir string -} - // FolderChange is called when configuration has changed -func (s *SyncThing) FolderChange(f FolderChangeArg) error { +func (s *SyncThing) FolderChange(f xdsconfig.FolderConfig) error { // Get current config stCfg, err := s.ConfigGet() @@ -63,7 +55,7 @@ func (s *SyncThing) FolderChange(f FolderChangeArg) error { folder := config.FolderConfiguration{ ID: id, Label: label, - RawPath: filepath.Join(f.ShareRootDir, f.RelativePath), + RawPath: filepath.Join(s.conf.ShareRootDir, f.RelativePath), } folder.Devices = append(folder.Devices, config.FolderDeviceConfiguration{