feat(macros): add Type (#1394)

This commit is contained in:
Brandon Beck 2024-02-08 07:39:49 -06:00 committed by GitHub
parent c211641c29
commit 90272188ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -29,6 +29,7 @@ type Macro struct {
InfoUrl string
Indexer string
Title string
Type string
Category string
Categories []string
Resolution string
@ -65,6 +66,7 @@ func NewMacro(release Release) Macro {
DownloadUrl: release.DownloadURL,
Indexer: release.Indexer,
Title: release.Title,
Type: release.Type,
Category: release.Category,
Categories: release.Categories,
Resolution: release.Resolution,

View file

@ -227,6 +227,15 @@ func TestMacros_Parse(t *testing.T) {
want: "movies-thisgrp",
wantErr: false,
},
{
name: "test_type",
release: Release{
Type: "episode",
},
args: args{text: "Type: {{ .Type }}"},
want: "Type: episode",
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {