From ab0e89b8dd232cca8b583f515a5ddf22c24cf9f9 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 5 Nov 2007 02:52:57 +0000 Subject: fixed multi-genre random play --- lib/class/random.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/class') diff --git a/lib/class/random.class.php b/lib/class/random.class.php index 8887bd28..38ff2d13 100644 --- a/lib/class/random.class.php +++ b/lib/class/random.class.php @@ -266,15 +266,13 @@ class Random { if (is_array($matchlist)) { foreach ($matchlist as $type => $value) { if (is_array($value)) { - $where .= "("; foreach ($value as $v) { if (!strlen($v)) { continue; } $v = Dba::escape($v); if ($v != $value[0]) { $where .= " OR $type='$v' "; } else { $where .= " AND ( $type='$v'"; } } - $where .= ")"; - $where = rtrim($where,"()"); + $where .= ")"; } elseif (strlen($value)) { $value = Dba::escape($value); @@ -282,7 +280,6 @@ class Random { } } // end foreach } // end if matchlist - if ($data['random_type'] == 'full_album') { $query = "SELECT `album`.`id` FROM `song` INNER JOIN `album` ON `song`.`album`=`album`.`id` " . -- cgit