Handle deletes better

This commit is contained in:
Ben Sarmiento
2023-12-02 03:09:58 +01:00
parent 1cb80e5047
commit a8e8bab853
2 changed files with 25 additions and 15 deletions

View File

@@ -32,6 +32,10 @@ func HandleDeleteFile(directory, torrentName, fileName string, t *torrent.Torren
return fmt.Errorf("cannot find file %s", fileName)
}
file.Link = "unselect"
t.UpdateTorrentResponseCache(torrent)
if t.CheckDeletedState(torrent) {
t.Delete(torrentName, true, true)
} else {
t.UpdateTorrentResponseCache(torrent)
}
return nil
}