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:
Simon Frei
2026-06-04 18:28:19 +00:00
committed by GitHub
co-authored by Marcus B Spencer Jakob Borg
parent 6df85dc95c
commit e16b8013a6
6 changed files with 107 additions and 1 deletions
+11
View File
@@ -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) {