fix: empty tmpFile var passed to download client's action (#121)

Co-authored-by: zmiguel <contact@zmiguel.me>
This commit is contained in:
ZMiguel Valdiviesso 2022-02-07 16:24:58 +00:00 committed by GitHub
parent 8c9f9495ba
commit 6da581bf92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,8 @@ func (s *service) runAction(action domain.Action, release domain.Release) error
} }
tmpFile = t.TmpFileName tmpFile = t.TmpFileName
} else {
tmpFile = release.TorrentTmpFile
} }
s.execCmd(release, action, tmpFile) s.execCmd(release, action, tmpFile)
@ -77,7 +79,10 @@ func (s *service) runAction(action domain.Action, release domain.Release) error
} }
tmpFile = t.TmpFileName tmpFile = t.TmpFileName
} else {
tmpFile = release.TorrentTmpFile
} }
s.watchFolder(action.WatchFolder, tmpFile) s.watchFolder(action.WatchFolder, tmpFile)
case domain.ActionTypeDelugeV1, domain.ActionTypeDelugeV2: case domain.ActionTypeDelugeV1, domain.ActionTypeDelugeV2:
@ -98,7 +103,10 @@ func (s *service) runAction(action domain.Action, release domain.Release) error
} }
tmpFile = t.TmpFileName tmpFile = t.TmpFileName
} else {
tmpFile = release.TorrentTmpFile
} }
err = s.deluge(action, tmpFile) err = s.deluge(action, tmpFile)
if err != nil { if err != nil {
log.Error().Stack().Err(err).Msg("error sending torrent to Deluge") 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 tmpFile = t.TmpFileName
hash = t.MetaInfo.HashInfoBytes().String() hash = t.MetaInfo.HashInfoBytes().String()
} else {
tmpFile = release.TorrentTmpFile
} }
err = s.qbittorrent(client, action, hash, tmpFile) err = s.qbittorrent(client, action, hash, tmpFile)
if err != nil { if err != nil {
log.Error().Stack().Err(err).Msg("error sending torrent to qBittorrent") log.Error().Stack().Err(err).Msg("error sending torrent to qBittorrent")