From 6da581bf92b9b1ed393fbe40da3c3d9a92472920 Mon Sep 17 00:00:00 2001 From: ZMiguel Valdiviesso Date: Mon, 7 Feb 2022 16:24:58 +0000 Subject: [PATCH] fix: empty tmpFile var passed to download client's action (#121) Co-authored-by: zmiguel --- internal/action/run.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/action/run.go b/internal/action/run.go index 57caadd..454b885 100644 --- a/internal/action/run.go +++ b/internal/action/run.go @@ -64,6 +64,8 @@ func (s *service) runAction(action domain.Action, release domain.Release) error } tmpFile = t.TmpFileName + } else { + tmpFile = release.TorrentTmpFile } s.execCmd(release, action, tmpFile) @@ -77,7 +79,10 @@ func (s *service) runAction(action domain.Action, release domain.Release) error } tmpFile = t.TmpFileName + } else { + tmpFile = release.TorrentTmpFile } + s.watchFolder(action.WatchFolder, tmpFile) case domain.ActionTypeDelugeV1, domain.ActionTypeDelugeV2: @@ -98,7 +103,10 @@ func (s *service) runAction(action domain.Action, release domain.Release) error } tmpFile = t.TmpFileName + } else { + tmpFile = release.TorrentTmpFile } + err = s.deluge(action, tmpFile) if err != nil { log.Error().Stack().Err(err).Msg("error sending torrent to Deluge") @@ -124,7 +132,10 @@ func (s *service) runAction(action domain.Action, release domain.Release) error tmpFile = t.TmpFileName hash = t.MetaInfo.HashInfoBytes().String() + } else { + tmpFile = release.TorrentTmpFile } + err = s.qbittorrent(client, action, hash, tmpFile) if err != nil { log.Error().Stack().Err(err).Msg("error sending torrent to qBittorrent")