Skip to content

Commit

Permalink
feat(macros): add Group (#1378)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincejv committed Jan 26, 2024
1 parent fffd5bb commit 16bf2a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/domain/macros.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Macro struct {
TorrentUrl string
TorrentDataRawBytes []byte
MagnetURI string
Group string
GroupID string
DownloadUrl string
InfoUrl string
Expand Down Expand Up @@ -58,6 +59,7 @@ func NewMacro(release Release) Macro {
TorrentHash: release.TorrentHash,
TorrentID: release.TorrentID,
MagnetURI: release.MagnetURI,
Group: release.Group,
GroupID: release.GroupID,
InfoUrl: release.InfoURL,
DownloadUrl: release.DownloadURL,
Expand Down
13 changes: 13 additions & 0 deletions internal/domain/macros_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,19 @@ func TestMacros_Parse(t *testing.T) {
want: "DownloadUrl: https://test.local/this/page/1001",
wantErr: false,
},
{
name: "test_group",
release: Release{
TorrentName: "This movie 2021",
DownloadURL: "https://some.site/download/fakeid",
Group: "thisgrp",
Indexer: "mock1",
Year: 2021,
},
args: args{text: "movies-{{.Group}}"},
want: "movies-thisgrp",
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 16bf2a5

Please sign in to comment.