diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-06 16:26:32 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-06 16:26:32 +0000 |
commit | 5174ce434a74fb24b64b5559836fb508eefeaae5 (patch) | |
tree | 12cdfeb41a097a8e1cf44c65120e83e3daaeeccf /lib | |
parent | c0da5afbc92ffde4b698f942923696cd831d8b3f (diff) | |
download | ampache-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.php | 8 |
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"; } |