mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(actions): deluge v2 download file and check rules (#369)
This commit is contained in:
parent
497140a6c4
commit
16dd8c5419
1 changed files with 18 additions and 2 deletions
|
@ -117,8 +117,7 @@ func (s *service) delugeV1(client *domain.DownloadClient, action domain.Action,
|
|||
}
|
||||
|
||||
if release.TorrentTmpFile == "" {
|
||||
err = release.DownloadTorrentFile()
|
||||
if err != nil {
|
||||
if err = release.DownloadTorrentFile(); err != nil {
|
||||
s.log.Error().Err(err).Msgf("could not download torrent file for release: %v", release.TorrentName)
|
||||
return nil, err
|
||||
}
|
||||
|
@ -196,6 +195,23 @@ func (s *service) delugeV2(client *domain.DownloadClient, action domain.Action,
|
|||
|
||||
defer deluge.Close()
|
||||
|
||||
// perform connection to Deluge server
|
||||
rejections, err := s.delugeCheckRulesCanDownload(deluge, client, action)
|
||||
if err != nil {
|
||||
s.log.Error().Err(err).Msgf("error checking client rules: %v", action.Name)
|
||||
return nil, err
|
||||
}
|
||||
if rejections != nil {
|
||||
return rejections, nil
|
||||
}
|
||||
|
||||
if release.TorrentTmpFile == "" {
|
||||
if err = release.DownloadTorrentFile(); err != nil {
|
||||
s.log.Error().Err(err).Msgf("could not download torrent file for release: %v", release.TorrentName)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
t, err := ioutil.ReadFile(release.TorrentTmpFile)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not read torrent file: %v", release.TorrentTmpFile)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue