winleafs / Winleafs

Winleafs: Windows application for Nanoleaf lights
GNU General Public License v3.0
85 stars 9 forks source link

Added Spotify playlist event #119

Closed StijnOostdam closed 4 years ago

StijnOostdam commented 4 years ago

Please also test the functionality very carefully

StijnOostdam commented 4 years ago
2020-03-18 07:56:48.8462|WARN|Winleafs.Wpf.Api.Events.SpotifyEventTrigger|Retrieving the Spotify current playlist failed.
System.ArgumentException: An item with the same key has already been added. Key: System.Net.Http.Headers.HeaderDescriptor
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at System.Net.Http.Headers.HttpHeaders.GetOrCreateHeaderInfo(HeaderDescriptor descriptor, Boolean parseRawValues)
   at SpotifyAPI.Web.SpotifyWebClient.AddHeaders(Dictionary`2 headers)
   at SpotifyAPI.Web.SpotifyWebClient.DownloadRawAsync(String url, Dictionary`2 headers)
   at SpotifyAPI.Web.SpotifyWebClient.DownloadAsync(String url, Dictionary`2 headers)
   at SpotifyAPI.Web.SpotifyWebClient.DownloadJsonAsync[T](String url, Dictionary`2 headers)
   at SpotifyAPI.Web.SpotifyWebAPI.DownloadDataAsync[T](String url)
   at Winleafs.Wpf.Helpers.Spotify.GetCurrentPlayingPlaylist() in Winleafs\Winleafs.Wpf\Helpers\Spotify.cs:line 63
   at Winleafs.Wpf.Api.Events.SpotifyEventTrigger.CheckPlaylistAsync() in Winleafs\Winleafs.Wpf\Api\Events\SpotifyEventTrigger.cs:line 54
StijnOostdam commented 4 years ago

Exception fixed, I want to add a message on startup whether the spotify client is connected or not.

EDIT: done

bartdebever commented 4 years ago

image

bartdebever commented 4 years ago

image Have a dropdown that contains the playlists that the user has instead of putting in the name.

StijnOostdam commented 4 years ago

Also should add a message saying that it is only available to premium Spotify users due to API limitations

StijnOostdam commented 4 years ago

Access token only seems valid for a few hours