Skip to content

Commit

Permalink
Use fallback URL when AppleSongID is unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyMartynov committed Mar 30, 2024
1 parent 541d308 commit c63d9b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tagging/ShazamApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ static void PopulateAttributes(JsonElement rootElement, ShazamResult result) {
}

PopulateAppleID(shazamSongElement, result);

if(String.IsNullOrEmpty(result.AppleSongID)) {
// As of March 2024
// shazam.com/track/[ID] redirects to shazam.com/song/[AppleSongID]
result.Url = result.Url.Replace("/track/", "/snippets/email-share/");
}
}

static string ImproveUrl(string url) {
Expand Down

0 comments on commit c63d9b7

Please sign in to comment.