Repair rework
This commit is contained in:
@@ -154,22 +154,7 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
|
||||
Link: "", // no link yet
|
||||
})
|
||||
}
|
||||
if len(selectedFiles) > len(info.Links) && info.Progress == 100 {
|
||||
if len(info.Links) == 1 {
|
||||
// this usually is a rar file issue
|
||||
if t.Config.ShouldDeleteRarFiles() {
|
||||
t.log.Warnf("Torrent %s id=%s is a rar file, it cannot be repaired. Deleting...", info.Name, info.ID)
|
||||
t.Api.DeleteTorrent(info.ID)
|
||||
} else {
|
||||
t.log.Warnf("Torrent %s id=%s is a rar file, it cannot be repaired as it's a known Real-Debrid limitation. zurg recommends you delete this torrent or add auto_delete_rar_torrents: true in your config.yml", info.Name, info.ID)
|
||||
torrent.Unfixable = true
|
||||
}
|
||||
return nil
|
||||
} else {
|
||||
t.log.Warnf("Torrent id=%s is partly expired. It has %d selected files but only %d links", info.ID, len(selectedFiles), len(info.Links))
|
||||
torrent.ForRepair = true
|
||||
}
|
||||
} else if len(selectedFiles) == len(info.Links) {
|
||||
if len(selectedFiles) == len(info.Links) {
|
||||
// all links are still intact! good!
|
||||
for i, file := range selectedFiles {
|
||||
file.Link = info.Links[i]
|
||||
@@ -209,6 +194,7 @@ func (t *TorrentManager) mergeToMain(existing, toMerge *Torrent) Torrent {
|
||||
mainTorrent.Hash = existing.Hash
|
||||
mainTorrent.DownloadedIDs = mapset.NewSet[string]()
|
||||
mainTorrent.InProgressIDs = mapset.NewSet[string]()
|
||||
mainTorrent.Unfixable = existing.Unfixable || toMerge.Unfixable
|
||||
|
||||
// this function triggers only when we have a new DownloadedID
|
||||
toMerge.DownloadedIDs.Difference(existing.DownloadedIDs).Each(func(id string) bool {
|
||||
|
||||
Reference in New Issue
Block a user