fix(macros): TorrentHash empty (#1699)

fix(macros): TorrentHash empty
This commit is contained in:
ze0s 2024-09-02 15:44:36 +02:00 committed by GitHub
parent 89cf68e773
commit d380c0b178
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 30 deletions

View file

@ -186,6 +186,22 @@ type FilterExternal struct {
FilterId int `json:"-"`
}
func (f FilterExternal) NeedTorrentDownloaded() bool {
if strings.Contains(f.ExecArgs, "TorrentHash") || strings.Contains(f.WebhookData, "TorrentHash") {
return true
}
if strings.Contains(f.ExecArgs, "TorrentPathName") || strings.Contains(f.WebhookData, "TorrentPathName") {
return true
}
if strings.Contains(f.WebhookData, "TorrentDataRawBytes") {
return true
}
return false
}
type FilterExternalType string
const (