mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(macros): add Type (#1394)
This commit is contained in:
parent
c211641c29
commit
90272188ca
2 changed files with 11 additions and 0 deletions
|
@ -29,6 +29,7 @@ type Macro struct {
|
||||||
InfoUrl string
|
InfoUrl string
|
||||||
Indexer string
|
Indexer string
|
||||||
Title string
|
Title string
|
||||||
|
Type string
|
||||||
Category string
|
Category string
|
||||||
Categories []string
|
Categories []string
|
||||||
Resolution string
|
Resolution string
|
||||||
|
@ -65,6 +66,7 @@ func NewMacro(release Release) Macro {
|
||||||
DownloadUrl: release.DownloadURL,
|
DownloadUrl: release.DownloadURL,
|
||||||
Indexer: release.Indexer,
|
Indexer: release.Indexer,
|
||||||
Title: release.Title,
|
Title: release.Title,
|
||||||
|
Type: release.Type,
|
||||||
Category: release.Category,
|
Category: release.Category,
|
||||||
Categories: release.Categories,
|
Categories: release.Categories,
|
||||||
Resolution: release.Resolution,
|
Resolution: release.Resolution,
|
||||||
|
|
|
@ -227,6 +227,15 @@ func TestMacros_Parse(t *testing.T) {
|
||||||
want: "movies-thisgrp",
|
want: "movies-thisgrp",
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "test_type",
|
||||||
|
release: Release{
|
||||||
|
Type: "episode",
|
||||||
|
},
|
||||||
|
args: args{text: "Type: {{ .Type }}"},
|
||||||
|
want: "Type: episode",
|
||||||
|
wantErr: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue