Add accidental removal fix

This commit is contained in:
Ben Adrian Sarmiento
2024-07-19 04:42:09 +02:00
parent eaabd20a83
commit d2c1e12e2c
6 changed files with 17 additions and 15 deletions

View File

@@ -590,13 +590,10 @@ func (t *TorrentManager) canCapacityHandle() bool {
}
func (t *TorrentManager) markAsUnplayable(torrent *Torrent) {
// reassign to unplayable torrents directory
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) {
if strings.HasPrefix(directory, "int__") {
return
}
for _, directory := range t.Config.GetDirectories() {
torrents, _ := t.DirectoryMap.Get(directory)
torrents.Remove(t.GetKey(torrent))
})
}
torrents, _ := t.DirectoryMap.Get(config.UNPLAYABLE_TORRENTS)
torrents.Set(t.GetKey(torrent), torrent)
}