Fix rar fixer
This commit is contained in:
@@ -150,21 +150,15 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
|
|||||||
}
|
}
|
||||||
if len(selectedFiles) > len(info.Links) && info.Progress == 100 {
|
if len(selectedFiles) > len(info.Links) && info.Progress == 100 {
|
||||||
if len(info.Links) == 1 {
|
if len(info.Links) == 1 {
|
||||||
// this might be a rar file so let's check
|
// this usually is a rar file issue
|
||||||
unrestrict := t.UnrestrictUntilOk(info.Links[0])
|
if t.Config.ShouldDeleteRarFiles() {
|
||||||
if unrestrict != nil && strings.HasPrefix(strings.ToLower(unrestrict.Filename), ".rar") {
|
t.log.Warnf("Torrent %s id=%s is a rar file, it cannot be repaired. Deleting...", info.Name, info.ID)
|
||||||
if t.Config.ShouldDeleteRarFiles() {
|
t.Api.DeleteTorrent(info.ID)
|
||||||
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 {
|
} 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))
|
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.ForRepair = true
|
torrent.Unfixable = true
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
} else {
|
} 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))
|
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
|
torrent.ForRepair = true
|
||||||
|
|||||||
Reference in New Issue
Block a user