Add logs route, add rar handler
This commit is contained in:
@@ -149,8 +149,26 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
|
||||
})
|
||||
}
|
||||
if len(selectedFiles) > len(info.Links) && info.Progress == 100 {
|
||||
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
|
||||
if len(info.Links) == 1 {
|
||||
// this might be a rar file so let's check
|
||||
unrestrict := t.UnrestrictUntilOk(info.Links[0])
|
||||
if unrestrict != nil && strings.HasPrefix(strings.ToLower(unrestrict.Filename), ".rar") {
|
||||
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)
|
||||
return nil
|
||||
} 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 enable delete_rar_files in your config.yml", info.Name, info.ID)
|
||||
torrent.Unfixable = true
|
||||
}
|
||||
} else {
|
||||
t.log.Warnf("Torrent id=%s is partly expired. It has %d selected files but only 1 link", info.ID, len(selectedFiles), len(info.Links))
|
||||
torrent.ForRepair = true
|
||||
}
|
||||
} 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) {
|
||||
// all links are still intact! good!
|
||||
for i, file := range selectedFiles {
|
||||
|
||||
Reference in New Issue
Block a user