Repair works now
This commit is contained in:
@@ -483,17 +483,12 @@ func (t *TorrentManager) canCapacityHandle() bool {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) markAsUnplayable(torrent *Torrent, reason string) {
|
||||
if torrent.State.Is("unplayable_torrent") {
|
||||
return
|
||||
}
|
||||
t.log.Warnf("Marking torrent %s as unplayable - %s", t.GetKey(torrent), reason)
|
||||
if err := torrent.State.Event(context.Background(), "mark_as_unplayable_torrent"); err != nil {
|
||||
t.log.Errorf("Failed to mark torrent %s as unplayable: %v", t.GetKey(torrent), err)
|
||||
return
|
||||
}
|
||||
t.writeTorrentToFile(torrent)
|
||||
t.log.Warnf("Torrent %s is unplayable (reason: %s), moving to unplayable directory", t.GetKey(torrent), reason)
|
||||
// reassign to unplayable torrents directory
|
||||
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) {
|
||||
if strings.HasPrefix(directory, "int__") {
|
||||
return
|
||||
}
|
||||
torrents.Remove(t.GetKey(torrent))
|
||||
})
|
||||
torrents, _ := t.DirectoryMap.Get(config.UNPLAYABLE_TORRENTS)
|
||||
|
||||
Reference in New Issue
Block a user