mirror of
https://github.com/syncthing/syncthing.git
synced 2025-12-23 22:18:14 -05:00
chore(lib): expose model methods to obtain progress (#9886)
### Purpose This exposes four methods from `Model` through `Internals`. It allows apps like Synctrain to obtain information about local/remote need and sync progress. ### Testing No testing seems necessary, functions are exported verbatim. ### Screenshots N/a ### Documentation Not public API, I am aware this interface may change at any time. ## Authorship OK. Co-authored-by: Ross Smith II <ross@smithii.com> Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
committed by
GitHub
parent
7f3c8dbff1
commit
3c955a9706
@@ -84,3 +84,21 @@ func (m *Internals) DBSnapshot(folderID string) (*db.Snapshot, error) {
|
||||
func (m *Internals) ScanFolderSubdirs(folderID string, paths []string) error {
|
||||
return m.model.ScanFolderSubdirs(folderID, paths)
|
||||
}
|
||||
|
||||
func (m *Internals) FolderProgressBytesCompleted(folder string) int64 {
|
||||
return m.model.FolderProgressBytesCompleted(folder)
|
||||
}
|
||||
|
||||
// NeedFolderFiles returns paginated list of currently needed files in
|
||||
// progress, queued, and to be queued on next puller iteration.
|
||||
func (m *Internals) NeedFolderFiles(folder string, page, perpage int) ([]protocol.FileInfo, []protocol.FileInfo, []protocol.FileInfo, error) {
|
||||
return m.model.NeedFolderFiles(folder, page, perpage)
|
||||
}
|
||||
|
||||
func (m *Internals) RemoteNeedFolderFiles(folder string, device protocol.DeviceID, page, perpage int) ([]protocol.FileInfo, error) {
|
||||
return m.model.RemoteNeedFolderFiles(folder, device, page, perpage)
|
||||
}
|
||||
|
||||
func (m *Internals) LocalChangedFolderFiles(folder string, page, perpage int) ([]protocol.FileInfo, error) {
|
||||
return m.model.LocalChangedFolderFiles(folder, page, perpage)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user