From 0068d79a8b3c9c9caceb7b1e12d71b03825d5b55 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Tue, 29 Nov 2005 00:35:19 +0000 Subject: unrandom counted the play random so its only randomly ordered... say that three times fast --- lib/class/album.class.php | 2 +- lib/class/playlist.class.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/class') 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; -- cgit