| @@ -34,6 +34,8 @@ namespace Discord | |||||
| public static string GetSpotifyAlbumArtUrl(string albumArtId) | public static string GetSpotifyAlbumArtUrl(string albumArtId) | ||||
| => $"https://i.scdn.co/image/{albumArtId}"; | => $"https://i.scdn.co/image/{albumArtId}"; | ||||
| public static string GetSpotifyDirectUrl(string trackId) | |||||
| => $"https://open.spotify.com/track/{trackId}"; | |||||
| private static string FormatToExtension(ImageFormat format, string imageId) | private static string FormatToExtension(ImageFormat format, string imageId) | ||||
| { | { | ||||
| @@ -12,6 +12,7 @@ namespace Discord | |||||
| public string AlbumTitle { get; internal set; } | public string AlbumTitle { get; internal set; } | ||||
| public string TrackTitle { get; internal set; } | public string TrackTitle { get; internal set; } | ||||
| public string TrackId { get; internal set; } | public string TrackId { get; internal set; } | ||||
| public string TrackUrl { get; internal set; } | |||||
| public string SessionId { get; internal set; } | public string SessionId { get; internal set; } | ||||
| public TimeSpan? Duration { get; internal set; } | public TimeSpan? Duration { get; internal set; } | ||||
| @@ -19,6 +19,7 @@ namespace Discord.WebSocket | |||||
| Name = model.Name, | Name = model.Name, | ||||
| SessionId = model.SessionId.GetValueOrDefault(), | SessionId = model.SessionId.GetValueOrDefault(), | ||||
| TrackId = model.SyncId.Value, | TrackId = model.SyncId.Value, | ||||
| TrackUrl = CDN.GetSpotifyDirectUrl(model.SyncId.Value), | |||||
| AlbumTitle = albumText, | AlbumTitle = albumText, | ||||
| TrackTitle = model.Details.GetValueOrDefault(), | TrackTitle = model.Details.GetValueOrDefault(), | ||||
| Artists = model.State.GetValueOrDefault()?.Split(';').Select(x=>x?.Trim()).ToImmutableArray(), | Artists = model.State.GetValueOrDefault()?.Split(';').Select(x=>x?.Trim()).ToImmutableArray(), | ||||