Rework torrent manager handling of update
This commit is contained in:
@@ -14,7 +14,7 @@ func HandleDeleteTorrent(directory, torrentName string, t *torrent.TorrentManage
|
||||
if !torrents.Has(torrentName) {
|
||||
return fmt.Errorf("cannot find torrent %s", torrentName)
|
||||
}
|
||||
t.Delete(torrentName)
|
||||
t.Delete(torrentName, true, true)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -23,15 +23,15 @@ func HandleDeleteFile(directory, torrentName, fileName string, t *torrent.Torren
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot find directory %s", directory)
|
||||
}
|
||||
tor, ok := torrents.Get(torrentName)
|
||||
torrent, ok := torrents.Get(torrentName)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot find torrent %s", torrentName)
|
||||
}
|
||||
file, ok := tor.SelectedFiles.Get(fileName)
|
||||
file, ok := torrent.SelectedFiles.Get(fileName)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot find file %s", fileName)
|
||||
}
|
||||
file.Link = "unselect"
|
||||
t.ScheduleForRefresh()
|
||||
t.UpdateTorrentResponseCache(torrent)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user