diff options
-rw-r--r-- | lib/class/album.class.php | 2 | ||||
-rw-r--r-- | lib/class/playlist.class.php | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php index b2db78a0..af2cd200 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -326,7 +326,7 @@ class Album { $results = array(); - $sql = "SELECT id FROM song WHERE album='$this->id' ORDER BY RAND() LIMIT " . rand(1,$this->songs); + $sql = "SELECT id FROM song WHERE album='$this->id' ORDER BY RAND()"; $db_results = mysql_query($sql, dbh()); while ($r = mysql_fetch_array($db_results)) { diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php index 7fa55492..b42ca188 100644 --- a/lib/class/playlist.class.php +++ b/lib/class/playlist.class.php @@ -344,12 +344,10 @@ class Playlist { $total_songs = mysql_fetch_row($db_results); - $limit = rand(1,$total_songs[0]); - // Fetch playlist items $sql = "SELECT song, track FROM playlist_data" . " WHERE playlist = '$this->id'" . - " ORDER BY RAND() LIMIT $limit"; + " ORDER BY RAND()"; $db_results = mysql_query($sql, dbh()); while ($r = mysql_fetch_object($db_results)) { $song_ids[] = $r->song; |