Skip to content

Commit

Permalink
feat(macros): add Artists (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
martylukyy committed Apr 8, 2024
1 parent f1b4214 commit b181231
Show file tree
Hide file tree
Showing 2 changed files with 11 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 @@ -49,6 +49,7 @@ type Macro struct {
CurrentMinute int
CurrentSecond int
Tags string
Artists string
}

func NewMacro(release Release) Macro {
Expand Down Expand Up @@ -88,6 +89,7 @@ func NewMacro(release Release) Macro {
CurrentMinute: currentTime.Minute(),
CurrentSecond: currentTime.Second(),
Tags: strings.Join(release.Tags, ", "),
Artists: release.Artists,
}

return ma
Expand Down
9 changes: 9 additions & 0 deletions internal/domain/macros_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,15 @@ func TestMacros_Parse(t *testing.T) {
want: "Tags: country, rock",
wantErr: false,
},
{
name: "test_artists",
release: Release{
Artists: "Jon Boy",
},
args: args{text: "Artists: {{ .Artists }}"},
want: "Artists: Jon Boy",
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit b181231

Please sign in to comment.