mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(actions): reduce metadata downloads (#341)
This commit is contained in:
parent
ebba72ec1f
commit
548cd382a6
2 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@ package action
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/autobrr/autobrr/internal/domain"
|
"github.com/autobrr/autobrr/internal/domain"
|
||||||
|
@ -13,7 +14,7 @@ import (
|
||||||
func (s *service) execCmd(action domain.Action, release domain.Release) error {
|
func (s *service) execCmd(action domain.Action, release domain.Release) error {
|
||||||
s.log.Debug().Msgf("action exec: %v release: %v", action.Name, release.TorrentName)
|
s.log.Debug().Msgf("action exec: %v release: %v", action.Name, release.TorrentName)
|
||||||
|
|
||||||
if release.TorrentTmpFile == "" {
|
if release.TorrentTmpFile == "" && strings.Contains(action.ExecArgs, "TorrentPathName") {
|
||||||
if err := release.DownloadTorrentFile(); err != nil {
|
if err := release.DownloadTorrentFile(); err != nil {
|
||||||
return errors.Wrap(err, "error downloading torrent file for release: %v", release.TorrentName)
|
return errors.Wrap(err, "error downloading torrent file for release: %v", release.TorrentName)
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/autobrr/autobrr/internal/domain"
|
"github.com/autobrr/autobrr/internal/domain"
|
||||||
|
@ -171,7 +172,7 @@ func (s *service) watchFolder(action domain.Action, release domain.Release) erro
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *service) webhook(action domain.Action, release domain.Release) error {
|
func (s *service) webhook(action domain.Action, release domain.Release) error {
|
||||||
if release.TorrentTmpFile == "" {
|
if release.TorrentTmpFile == "" && strings.Contains(action.WebhookData, "TorrentPathName") {
|
||||||
if err := release.DownloadTorrentFile(); err != nil {
|
if err := release.DownloadTorrentFile(); err != nil {
|
||||||
return errors.Wrap(err, "webhook: could not download torrent file for release: %v", release.TorrentName)
|
return errors.Wrap(err, "webhook: could not download torrent file for release: %v", release.TorrentName)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue