diff --git a/docs/filters/macros.md b/docs/filters/macros.md index cc6a8e83..0e40bf37 100644 --- a/docs/filters/macros.md +++ b/docs/filters/macros.md @@ -6,7 +6,7 @@ sidebar_label: Macros pagination_label: Filters - Macros --- -# Macros +import Macros from '/snippets/macros.mdx'; Macros are a great way to enhance your workflow by adding custom logic/data processing to the input data provided by autobrr. Macros are currently supported by input fields by Filters, in two sections: Actions and External (filters). @@ -32,39 +32,7 @@ Available Sprig function, along with the relevant examples can be found [at Pydi ## Available variables -| Variable | Description | -| ---------------------- | ------------------------------------------ | -| `{{.Artists}}` | Artists | -| `{{.Categories}}` | Categories | -| `{{.Category}}` | Category | -| `{{.CurrentDay}}` | Current Day | -| `{{.CurrentHour}}` | Current Hour | -| `{{.CurrentMinute}}` | Current Minute | -| `{{.CurrentMonth}}` | Current Month | -| `{{.CurrentSecond}}` | Current Second | -| `{{.CurrentYear}}` | Current Year | -| `{{.DownloadURL}}` | Download URL | -| `{{.Episode}}` | Parsed episode | -| `{{.FilterName}}` | Filter name | -| `{{.Group}}` | Release group | -| `{{.GroupID}}` | GroupID | -| `{{.HDR}}` | Parsed HDR (DV, HDR, HDR10) | -| `{{.Indexer}}` | Indexer identifier | -| `{{.IndexerName}}` | Indexer name | -| `{{.InfoUrl}}` | Info URL | -| `{{.Resolution}}` | Parsed resolution (1080p) | -| `{{.Season}}` | Parsed season | -| `{{.Size}}` | Size (in bytes) | -| `{{.SizeString}}` | SizeString (including unit string) | -| `{{.Source}}` | Parsed source (BluRay, WEB-DL) | -| `{{.Title}}` | Parsed title (That Movie) | -| `{{.TorrentHash}}` | Torrent hash | -| `{{.TorrentID}}` | TorrentID | -| `{{.TorrentName}}` | Release name as announced | -| `{{.TorrentPathName}}` | Path to downloaded .torrent file in `/tmp` | -| `{{.TorrentUrl}}` | Full url to download torrent | -| `{{.Type}}` | Type e.g. episode | -| `{{.Year}}` | Parsed year | + ## Examples diff --git a/snippets/macros.mdx b/snippets/macros.mdx new file mode 100644 index 00000000..99e0fc96 --- /dev/null +++ b/snippets/macros.mdx @@ -0,0 +1,78 @@ +
+Click to view supported variables + +| Variable | Type | Description | +| -------------------------------- | -------- | ------------------------------------------ | +| `{{.Artists}}` | string | Artists | +| `{{.Audio}}` | []string | Audio codecs/formats array | +| `{{.AudioChannels}}` | string | Audio channels configuration | +| `{{.AudioFormat}}` | string | Audio format | +| `{{.Bitrate}}` | string | Release bitrate | +| `{{.Bonus}}` | []string | Bonus features array | +| `{{.Categories}}` | []string | Categories | +| `{{.Category}}` | string | Category | +| `{{.Codec}}` | []string | Video codecs array | +| `{{.Container}}` | string | Container format | +| `{{.CurrentDay}}` | int | Current Day | +| `{{.CurrentHour}}` | int | Current Hour | +| `{{.CurrentMinute}}` | int | Current Minute | +| `{{.CurrentMonth}}` | int | Current Month | +| `{{.CurrentSecond}}` | int | Current Second | +| `{{.CurrentYear}}` | int | Current Year | +| `{{.Day}}` | int | Release day | +| `{{.Description}}` | string | Release description | +| `{{.DownloadURL}}` | string | Download URL | +| `{{.Episode}}` | int | Parsed episode | +| `{{.FilterID}}` | int | Filter identifier | +| `{{.FilterName}}` | string | Filter name | +| `{{.Freeleech}}` | bool | Freeleech status | +| `{{.FreeleechPercent}}` | int | Freeleech percentage | +| `{{.Group}}` | string | Release group | +| `{{.GroupID}}` | string | GroupID | +| `{{.HasCue}}` | bool | Has .cue file | +| `{{.HasLog}}` | bool | Has log file | +| `{{.HDR}}` | string | Parsed HDR (DV, HDR, HDR10) | +| `{{.Implementation}}` | string | Implementation type | +| `{{.Indexer}}` | string | Indexer identifier | +| `{{.IndexerIdentifier}}` | string | Indexer identifier | +| `{{.IndexerIdentifierExternal}}` | string | External indexer identifier | +| `{{.IndexerName}}` | string | Indexer name | +| `{{.InfoUrl}}` | string | Info URL | +| `{{.IsDuplicate}}` | bool | Is duplicate release | +| `{{.Language}}` | []string | Language array | +| `{{.Leechers}}` | int | Number of leechers | +| `{{.LogScore}}` | int | Log score for music releases | +| `{{.MagnetURI}}` | string | Magnet link URI | +| `{{.MetaIMDB}}` | string | IMDB ID | +| `{{.Month}}` | int | Release month | +| `{{.Origin}}` | string | Release origin | +| `{{.Other}}` | []string | Other attributes array | +| `{{.PreTime}}` | string | Pre time | +| `{{.Proper}}` | bool | Is proper release | +| `{{.Protocol}}` | string | Protocol type | +| `{{.RecordLabel}}` | string | Record label | +| `{{.Region}}` | string | Region information | +| `{{.Repack}}` | bool | Is repack release | +| `{{.Resolution}}` | string | Parsed resolution (1080p) | +| `{{.Season}}` | int | Parsed season | +| `{{.Seeders}}` | int | Number of seeders | +| `{{.Size}}` | uint | Size (in bytes) | +| `{{.SizeString}}` | string | SizeString (including unit string) | +| `{{.SkipDuplicateProfileID}}` | int | Skip duplicate profile ID | +| `{{.SkipDuplicateProfileName}}` | string | Skip duplicate profile name | +| `{{.Source}}` | string | Parsed source (BluRay, WEB-DL) | +| `{{.Tags}}` | string | Release tags (comma separated) | +| `{{.Title}}` | string | Parsed title (That Movie) | +| `{{.TorrentDataRawBytes}}` | []byte | Raw torrent file data | +| `{{.TorrentHash}}` | string | Torrent hash | +| `{{.TorrentID}}` | string | TorrentID | +| `{{.TorrentName}}` | string | Release name as announced | +| `{{.TorrentPathName}}` | string | Path to downloaded .torrent file in `/tmp` | +| `{{.TorrentTmpFile}}` | string | Temporary torrent file path | +| `{{.TorrentUrl}}` | string | Full url to download torrent | +| `{{.Type}}` | string | Type e.g. episode | +| `{{.Uploader}}` | string | Release uploader | +| `{{.Website}}` | string | Website URL | +| `{{.Year}}` | int | Parsed year | + +