mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
feat(macros): add FilterID (#1416)
This commit is contained in:
parent
c97becb4e3
commit
3c40c7bba8
2 changed files with 11 additions and 0 deletions
|
@ -35,6 +35,7 @@ type Macro struct {
|
|||
Resolution string
|
||||
Source string
|
||||
HDR string
|
||||
FilterID int
|
||||
FilterName string
|
||||
Size uint64
|
||||
SizeString string
|
||||
|
@ -72,6 +73,7 @@ func NewMacro(release Release) Macro {
|
|||
Resolution: release.Resolution,
|
||||
Source: release.Source,
|
||||
HDR: strings.Join(release.HDR, ", "),
|
||||
FilterID: release.FilterID,
|
||||
FilterName: release.FilterName,
|
||||
Size: release.Size,
|
||||
SizeString: humanize.Bytes(release.Size),
|
||||
|
|
|
@ -236,6 +236,15 @@ func TestMacros_Parse(t *testing.T) {
|
|||
want: "Type: episode",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "test_filter_id",
|
||||
release: Release{
|
||||
FilterID: 1,
|
||||
},
|
||||
args: args{text: "FilterID: {{ .FilterID }}"},
|
||||
want: "FilterID: 1",
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue