mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(actions): watch folder (#780)
* fix(macros): Download torrent for watchfolders * use in-memory torrent for watchfolder * Update run.go
This commit is contained in:
parent
81d494ec5c
commit
0564f0bf7a
2 changed files with 7 additions and 9 deletions
|
@ -59,7 +59,7 @@ func (a *Action) ParseMacros(release *Release) error {
|
|||
if release.TorrentTmpFile == "" &&
|
||||
(strings.Contains(a.ExecArgs, "TorrentPathName") || strings.Contains(a.ExecArgs, "TorrentDataRawBytes") ||
|
||||
strings.Contains(a.WebhookData, "TorrentPathName") || strings.Contains(a.WebhookData, "TorrentDataRawBytes") ||
|
||||
strings.Contains(a.SavePath, "TorrentPathName")) {
|
||||
strings.Contains(a.SavePath, "TorrentPathName") || a.Type == ActionTypeWatchFolder) {
|
||||
if err := release.DownloadTorrentFile(); err != nil {
|
||||
return errors.Wrap(err, "webhook: could not download torrent file for release: %v", release.TorrentName)
|
||||
}
|
||||
|
@ -67,7 +67,8 @@ func (a *Action) ParseMacros(release *Release) error {
|
|||
|
||||
// if webhook data contains TorrentDataRawBytes, lets read the file into bytes we can then use in the macro
|
||||
if len(release.TorrentDataRawBytes) == 0 &&
|
||||
(strings.Contains(a.ExecArgs, "TorrentDataRawBytes") || strings.Contains(a.WebhookData, "TorrentDataRawBytes")) {
|
||||
(strings.Contains(a.ExecArgs, "TorrentDataRawBytes") || strings.Contains(a.WebhookData, "TorrentDataRawBytes") ||
|
||||
a.Type == ActionTypeWatchFolder) {
|
||||
t, err := os.ReadFile(release.TorrentTmpFile)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not read torrent file: %v", release.TorrentTmpFile)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue