Improve SpotifyGame (#1039)
* Initial commit * Add TrackUrl * Rename AlbumArt to AlbumArtUrl for consistency
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
|
||||
namespace Discord.WebSocket
|
||||
{
|
||||
internal static class EntityExtensions
|
||||
@@ -15,12 +18,13 @@ namespace Discord.WebSocket
|
||||
{
|
||||
Name = model.Name,
|
||||
SessionId = model.SessionId.GetValueOrDefault(),
|
||||
SyncId = model.SyncId.Value,
|
||||
TrackId = model.SyncId.Value,
|
||||
TrackUrl = CDN.GetSpotifyDirectUrl(model.SyncId.Value),
|
||||
AlbumTitle = albumText,
|
||||
TrackTitle = model.Details.GetValueOrDefault(),
|
||||
Artists = model.State.GetValueOrDefault()?.Split(';'),
|
||||
Artists = model.State.GetValueOrDefault()?.Split(';').Select(x=>x?.Trim()).ToImmutableArray(),
|
||||
Duration = timestamps?.End - timestamps?.Start,
|
||||
AlbumArt = albumArtId != null ? CDN.GetSpotifyAlbumArtUrl(albumArtId) : null,
|
||||
AlbumArtUrl = albumArtId != null ? CDN.GetSpotifyAlbumArtUrl(albumArtId) : null,
|
||||
Type = ActivityType.Listening
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user