chore(db, model): separate methods to drop a device vs its files (#10480)
Fixes #10469 --------- Signed-off-by: Simon Frei <freisim93@gmail.com> Signed-off-by: Jakob Borg <jakob@kastelo.net> Co-authored-by: Marcus B Spencer <marcus@marcusspencer.us> Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
co-authored by
Marcus B Spencer
Jakob Borg
parent
6df85dc95c
commit
e16b8013a6
@@ -255,6 +255,17 @@ func (s *DB) DropAllFiles(folder string, device protocol.DeviceID) error {
|
||||
return fdb.DropAllFiles(device)
|
||||
}
|
||||
|
||||
func (s *DB) DropFolderDevice(folder string, device protocol.DeviceID) error {
|
||||
fdb, err := s.getFolderDB(folder, false)
|
||||
if errors.Is(err, errNoSuchFolder) {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return fdb.DropDevice(device)
|
||||
}
|
||||
|
||||
func (s *DB) DropFilesNamed(folder string, device protocol.DeviceID, names []string) error {
|
||||
fdb, err := s.getFolderDB(folder, false)
|
||||
if errors.Is(err, errNoSuchFolder) {
|
||||
|
||||
Reference in New Issue
Block a user