Still add unplayable torrents to __all__

This commit is contained in:
Ben Adrian Sarmiento
2024-07-19 13:12:26 +02:00
parent ee6056ec04
commit 740ce9bda6

View File

@@ -590,12 +590,20 @@ func (t *TorrentManager) canCapacityHandle() bool {
} }
func (t *TorrentManager) markAsUnplayable(torrent *Torrent) { func (t *TorrentManager) markAsUnplayable(torrent *Torrent) {
accessKey := t.GetKey(torrent)
for _, directory := range t.Config.GetDirectories() { for _, directory := range t.Config.GetDirectories() {
torrents, _ := t.DirectoryMap.Get(directory) if directory == config.DOWNLOADS || directory == config.DUMPED_TORRENTS {
torrents.Remove(t.GetKey(torrent)) return
} }
torrents, _ := t.DirectoryMap.Get(config.UNPLAYABLE_TORRENTS) torrents, _ := t.DirectoryMap.Get(directory)
torrents.Set(t.GetKey(torrent), torrent) torrents.Remove(accessKey)
}
torrents, _ := t.DirectoryMap.Get(config.ALL_TORRENTS)
torrents.Set(accessKey, torrent)
torrents, _ = t.DirectoryMap.Get(config.UNPLAYABLE_TORRENTS)
torrents.Set(accessKey, torrent)
} }
func (t *TorrentManager) markAsUnfixable(torrent *Torrent, reason string) { func (t *TorrentManager) markAsUnfixable(torrent *Torrent, reason string) {