Alxandr / SpotiFire

A project to make a SpotifyClient in C#

Home Page:http://nudoc.azurewebsites.net/SpotiFire

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble with Album.Browse

opened this issue · comments

Hello Alxandr,

first of all I would like to thank you for sharing this great lib :)

Nearly everything I use works fine only the Album.Browse is causing exceptions! To reproduce this error I added two lines in your SpotiFire.TestClient:

            var playlist = await session.PlaylistContainer.Playlists[0];
            Console.WriteLine("Playing random from " + playlist.Name);
            var track = await playlist.Tracks[new Random().Next(playlist.Tracks.Count)];
            Console.WriteLine("Found track " + track.Name);
            await track.Album;

            // THESE ARE THE TWO LINES I ADDED AND WHICH CAUSE THE EXCEPTION:
            AlbumBrowse browse = await track.Album.Browse(); // <- Exception
            Console.WriteLine("Test: " + browse.Tracks[0].Name);

            var coverId = track.Album.CoverId;
            var image = await Image.FromId(session, coverId);
            var imageData = image.GetImage();
            imageData.Save("cover.jpg");

If the debugger is running, it stops in Session.cpp "main_thread":

sp_session_process_events(session->_ptr, &waitTime);

Can you reproduce this error or am I doing something wrong? Let me know if you need further information.

raketenhund

I've found the problem, and know what's causing it, just not entirely sure how to fix it yet.