summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-06 16:26:32 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-06 16:26:32 +0000
commit5174ce434a74fb24b64b5559836fb508eefeaae5 (patch)
tree12cdfeb41a097a8e1cf44c65120e83e3daaeeccf /lib
parentc0da5afbc92ffde4b698f942923696cd831d8b3f (diff)
downloadampache-5174ce434a74fb24b64b5559836fb508eefeaae5.tar.gz
ampache-5174ce434a74fb24b64b5559836fb508eefeaae5.tar.bz2
ampache-5174ce434a74fb24b64b5559836fb508eefeaae5.zip
fixed some sql snaufs that were causing the democratic play to not respect voting preference
Diffstat (limited to 'lib')
-rw-r--r--lib/class/tmp_playlist.class.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/class/tmp_playlist.class.php b/lib/class/tmp_playlist.class.php
index 52bcf4c5..656ad44b 100644
--- a/lib/class/tmp_playlist.class.php
+++ b/lib/class/tmp_playlist.class.php
@@ -86,8 +86,8 @@ class tmpPlaylist {
$order = 'ORDER BY id ASC';
if ($this->type == 'vote') {
- $order = "ORDER BY `count` DESC";
- $vote_select = ", user_vote.user AS `count`";
+ $order = "GROUP BY tmp_playlist_data.id ORDER BY `count` DESC";
+ $vote_select = ", COUNT(user_vote.user) AS `count`";
$vote_join = "LEFT JOIN user_vote ON user_vote.object_id=tmp_playlist_data.id";
}
@@ -122,8 +122,8 @@ class tmpPlaylist {
/* Check for an item on the playlist, account for voting */
if ($this->type == 'vote') {
/* Add conditions for voting */
- $vote_select = ", user_vote.user AS `count`";
- $order = " ORDER BY `count` DESC";
+ $vote_select = ", COUNT(user_vote.user) AS `count`";
+ $order = " GROUP BY tmp_playlist_data.id ORDER BY `count` DESC";
$vote_join = "LEFT JOIN user_vote ON user_vote.object_id=tmp_playlist_data.id";
}