Skip to content

Commit

Permalink
docs: add missing macros (#250)
Browse files Browse the repository at this point in the history
* docs: add missing macros

- converted to snippet file

* docs: wrap variables table in collapsible details element

* add type column and new skipDuplicate vars

* fix(types): update integer types for SkipDuplicateProfileID and Size fields

* add imdb id
  • Loading branch information
s0up4200 authored Dec 26, 2024
1 parent 9c4998a commit d323a91
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 34 deletions.
36 changes: 2 additions & 34 deletions docs/filters/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <strong>Actions</strong> and <strong>External (filters)</strong>.

Expand All @@ -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 |
<Macros />

## Examples

Expand Down
78 changes: 78 additions & 0 deletions snippets/macros.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<details>
<summary>Click to view supported variables</summary>

| 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 |

</details>

0 comments on commit d323a91

Please sign in to comment.