import (
"fmt"
- "github.com/iotbzh/xds-server/lib/common"
+ common "github.com/iotbzh/xds-common/golib"
"github.com/iotbzh/xds-server/lib/syncthing"
"github.com/iotbzh/xds-server/lib/xdsconfig"
)
Label: f.Label,
RelativePath: f.RelativePath,
SyncThingID: f.SyncThingID,
- ShareRootDir: c.ShareRootDir,
+ ShareRootDir: c.FileConf.ShareRootDir,
}); err != nil {
return err
}
func (c *Folder) UpdateFolder(newFolder xdsconfig.FolderConfig) (xdsconfig.FolderConfig, error) {
// rootPath should not be empty
if newFolder.RootPath == "" {
- newFolder.RootPath = c.Conf.ShareRootDir
+ newFolder.RootPath = c.Conf.FileConf.ShareRootDir
}
// Sanity check of folder settings
return fld, err
}
+
+// ForceSync Force the synchronization of a folder
+func (c *Folder) ForceSync(id string) error {
+ return c.SThg.FolderScan(id, "")
+}
+
+// IsFolderInSync Returns true when folder is in sync
+func (c *Folder) IsFolderInSync(id string) (bool, error) {
+ return c.SThg.IsFolderInSync(id)
+}