Clean up SpotifyGame PR

- Add a helper under CDN for cover art URLs
It would be bad practice of us to leave CDN urls hardcoded in the
deserializer, would be harder to change down the line should Spotify
ever change their CDN.

I'm not entirely supportive of leaving Spotify's CDN hardcoded in our lib
either, but there's no better alternative.

- Change SpotifyGame#Artists to an IEnumerable<string>
Seems pretty common to prefer IEnumerables in place of Arrays.
This commit is contained in:
Christopher F
2018-03-18 16:18:40 -04:00
parent 64b9cc7a53
commit 02c650773d
3 changed files with 6 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ namespace Discord.WebSocket
TrackTitle = model.Details.GetValueOrDefault(),
Artists = model.State.GetValueOrDefault()?.Split(';'),
Duration = timestamps?.End - timestamps?.Start,
AlbumArt = albumArtId != null ? $"https://i.scdn.co/image/{albumArtId}" : null,
AlbumArt = albumArtId != null ? CDN.GetSpotifyAlbumArtUrl(albumArtId) : null,
Type = ActivityType.Listening
};
}