Fix repairs for rared torrents

This commit is contained in:
Ben Adrian Sarmiento
2024-06-06 01:49:17 +02:00
parent cc19423420
commit 5a6b6b1546
5 changed files with 52 additions and 36 deletions

View File

@@ -190,6 +190,7 @@ func (t *TorrentManager) repair(torrent *Torrent) {
allPlayable = false
if t.Config.GetRarAction() == "extract" && file.ID != 0 {
t.repairLog.Debugf("Extracting file %s from rar'ed torrent %s", file.Path, t.GetKey(torrent))
info, _ := t.redownloadTorrent(torrent, []string{fmt.Sprintf("%d", file.ID)})
if info != nil {
t.setToBinOnceDone(info.ID)
@@ -381,7 +382,8 @@ func (t *TorrentManager) assignLinks(torrent *Torrent) bool {
torrent.SelectedFiles.IterCb(func(_ string, file *File) {
if utils.IsPlayable(file.Path) {
videoFiles = append(videoFiles, fmt.Sprintf("%d", file.ID))
} else {
} else if file.ID != 0 {
t.repairLog.Debugf("Extracting file %s from rar'ed torrent %s", file.Path, t.GetKey(torrent))
info, _ := t.redownloadTorrent(torrent, []string{fmt.Sprintf("%d", file.ID)})
if info != nil {
t.setToBinOnceDone(info.ID)