Fix bugs
This commit is contained in:
@@ -21,8 +21,8 @@ func (t *TorrentManager) CheckDeletedState(torrent *Torrent) bool {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
|
||||
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
|
||||
if deleteInRD {
|
||||
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
|
||||
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
|
||||
if torrent, ok := allTorrents.Get(accessKey); ok {
|
||||
torrent.DownloadedIDs.Each(func(id string) bool {
|
||||
@@ -34,8 +34,10 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
|
||||
})
|
||||
}
|
||||
}
|
||||
t.allAccessKeys.Remove(accessKey)
|
||||
t.log.Infof("Removing torrent %s from zurg database", accessKey)
|
||||
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) {
|
||||
torrents.Remove(accessKey)
|
||||
})
|
||||
allTorrents.Remove(accessKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user