Skip to content

Commit

Permalink
feat: remove unnessary variable
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <git@mattglei.ch>
  • Loading branch information
gleich committed Nov 29, 2024
1 parent 62c204b commit 613d78d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/apis/applemusic/song.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ type songResponse struct {
func songFromSongResponse(s songResponse) song {
if s.Attributes.URL == "" {
// remove special characters
re := regexp.MustCompile(`[^\w\s-]`)
slugURL := re.ReplaceAllString(s.Attributes.Name, "")
slugURL := regexp.MustCompile(`[^\w\s-]`).ReplaceAllString(s.Attributes.Name, "")
// replace spaces with hyphens
re = regexp.MustCompile(`\s+`)
slugURL = re.ReplaceAllString(slugURL, "-")
slugURL = regexp.MustCompile(`\s+`).ReplaceAllString(slugURL, "-")

u, err := url.JoinPath(
"https://music.apple.com/us/song/",
Expand Down

0 comments on commit 613d78d

Please sign in to comment.