summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-10 08:51:33 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-10 08:51:33 +0000
commit86148a427814fda15c6964317e3cbf5399ad4696 (patch)
treeb66873e0b7eb7c1881cf6dbfbf515d051f87c099 /server
parent6cde9118b11c0ca82ef415ea30a54db1b30fc1ce (diff)
downloadampache-86148a427814fda15c6964317e3cbf5399ad4696.tar.gz
ampache-86148a427814fda15c6964317e3cbf5399ad4696.tar.bz2
ampache-86148a427814fda15c6964317e3cbf5399ad4696.zip
re-added the edit users prefs mojo
Diffstat (limited to 'server')
-rw-r--r--server/random.ajax.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/random.ajax.php b/server/random.ajax.php
index 70429e09..269a6ec6 100644
--- a/server/random.ajax.php
+++ b/server/random.ajax.php
@@ -27,6 +27,10 @@ if (AJAX_INCLUDE != '1') { exit; }
switch ($_REQUEST['action']) {
case 'album':
$album_id = Random::album();
+
+ // If we don't get anything stop
+ if (!$album_id) { break; }
+
$album = new Album($album_id);
$songs = $album->get_songs();
foreach ($songs as $song_id) {
@@ -36,6 +40,10 @@ switch ($_REQUEST['action']) {
break;
case 'artist':
$artist_id = Random::artist();
+
+ // If we don't get anything stop
+ if (!$artist_id) { break; }
+
$artist = new Artist($artist_id);
$songs = $artist->get_songs();
foreach ($songs as $song_id) {
@@ -45,6 +53,10 @@ switch ($_REQUEST['action']) {
break;
case 'playlist':
$playlist_id = Random::playlist();
+
+ // If we don't get any results stop right here!
+ if (!$playlist_id) { break; }
+
$playlist = new Playlist($playlist_id);
$items = $playlist->get_items();
foreach ($items as $item) {