public static IntPtr[] GetArtistAlbums(IntPtr artistPtr) { using (Artist artist = new Artist(artistPtr)) { if (!waitFor(delegate { return libspotify.sp_artist_is_loaded(artist.ArtistPtr); }, REQUEST_TIMEOUT)) Log.Debug(Plugin.LOG_MODULE, "GetArtistAlbums() TIMEOUT waiting for artist to load"); if (artist.BeginBrowse()) { if (!waitFor(delegate() { return artist.IsBrowseComplete; }, REQUEST_TIMEOUT)) Log.Debug(Plugin.LOG_MODULE, "GetArtistAlbums() TIMEOUT waiting for browse to complete"); } if (artist.AlbumPtrs == null) return null; return artist.AlbumPtrs.ToArray(); } }
public IntPtr[] GetArtistAlbums(IntPtr artistPtr) { using (Artist artist = new Artist(artistPtr, _session)) { if (!waitFor(delegate { return libspotify.sp_artist_is_loaded(artist.ArtistPtr); }, REQUEST_TIMEOUT)) if (artist.BeginBrowse()) { if (!waitFor(delegate() { return artist.IsBrowseComplete; }, REQUEST_TIMEOUT)) throw new Exception("Timeout"); } if (artist.AlbumPtrs == null) return null; return artist.AlbumPtrs.ToArray(); } }