Ignore invalid urls generated when calling Autoplay

This commit is contained in:
Arnaud Bienner 2011-11-30 00:07:10 +01:00
parent 3f2faf818a
commit 5e80221e18
1 changed files with 7 additions and 0 deletions

View File

@ -51,11 +51,18 @@ PlaylistItemList GroovesharkRadio::Generate() {
} else {
song = service_->StartAutoplay(autoplay_state_);
}
// If the song url isn't valid, stop here
if (song.url().toString() == "grooveshark://0/0/0") {
return items;
}
PlaylistItemPtr playlist_item = PlaylistItemPtr(new InternetPlaylistItem(service_, song));
items << playlist_item;
first_time_ = false;
}
Song song = service_->GetAutoplaySong(autoplay_state_);
if (song.url().toString() == "grooveshark://0/0/0") {
return items;
}
PlaylistItemPtr playlist_item = PlaylistItemPtr(new InternetPlaylistItem(service_, song));
items << playlist_item;
return items;