proper marking of file as deleted

This commit is contained in:
Ben Sarmiento
2023-10-20 03:04:57 +02:00
parent 0e442fc9be
commit 59eb51b37b
9 changed files with 46 additions and 13 deletions

View File

@@ -254,6 +254,12 @@ func (t *TorrentManager) getInfo(torrentID string) *Torrent {
return torrent
}
func (t *TorrentManager) MarkFileAsDeleted(torrent *Torrent, file *File) {
log.Println("Marking file as deleted", file.Path)
file.Link = ""
t.writeToFile(torrent.ID, torrent)
}
func (t *TorrentManager) GetInfo(torrentID string) *Torrent {
for i := range t.torrents {
if t.torrents[i].ID == torrentID {