Addressing gemini's suggestion
Some checks failed
Build / Build (push) Has been cancelled
Some checks failed
Build / Build (push) Has been cancelled
This commit is contained in:
10
main.go
10
main.go
@@ -173,10 +173,12 @@ func (p *discordPlugin) NowPlaying(input scrobbler.NowPlayingRequest) error {
|
|||||||
case activityNameCustom:
|
case activityNameCustom:
|
||||||
template, _ := pdk.GetConfig(activityNameTemplateKey)
|
template, _ := pdk.GetConfig(activityNameTemplateKey)
|
||||||
if template != "" {
|
if template != "" {
|
||||||
activityName = template
|
r := strings.NewReplacer(
|
||||||
activityName = strings.ReplaceAll(activityName, "{track}", input.Track.Title)
|
"{track}", input.Track.Title,
|
||||||
activityName = strings.ReplaceAll(activityName, "{artist}", input.Track.Artist)
|
"{artist}", input.Track.Artist,
|
||||||
activityName = strings.ReplaceAll(activityName, "{album}", input.Track.Album)
|
"{album}", input.Track.Album,
|
||||||
|
)
|
||||||
|
activityName = r.Replace(template)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user