Permalink
Browse files

make sure that the album is loaded before returning it

  • Loading branch information...
1 parent cd7889d commit 13d06a07c968540df82f17e19f0165cd6ea11b57 @vilhelmk committed Oct 25, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 albumiterator.c
View
@@ -75,10 +75,15 @@ PHP_METHOD(SpotifyAlbumIterator, current)
spotifyalbumiterator_object *p;
sp_album *album;
zval temp, *spotifyobject;
+ int timeout;
p = (spotifyalbumiterator_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
album = sp_artistbrowse_album(p->artistbrowse, p->position);
+ while (!sp_album_is_loaded(album)) {
+ sp_session_process_events(p->session, &timeout);
+ }
+
spotifyobject = GET_THIS_PROPERTY(spotifyalbumiterator_ce, "spotify");
object_init_ex(return_value, spotifyalbum_ce);

0 comments on commit 13d06a0

Please sign in to comment.