diff options
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/democratic.class.php | 4 | ||||
-rw-r--r-- | lib/class/stream_playlist.class.php | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/class/democratic.class.php b/lib/class/democratic.class.php index 8b77f786..b6264fb7 100644 --- a/lib/class/democratic.class.php +++ b/lib/class/democratic.class.php @@ -343,7 +343,6 @@ class Democratic extends Tmp_Playlist { * already voted on any of these objects */ public function add_vote($items) { - /* Iterate through the objects if no vote, add to playlist and vote */ foreach ($items as $element) { $type = array_shift($element); @@ -417,8 +416,7 @@ class Democratic extends Tmp_Playlist { $db_results = Dba::write($sql); return true; - - } // add_vote + } /** * remove_vote diff --git a/lib/class/stream_playlist.class.php b/lib/class/stream_playlist.class.php index ae16dfb0..66b19297 100644 --- a/lib/class/stream_playlist.class.php +++ b/lib/class/stream_playlist.class.php @@ -376,13 +376,17 @@ class Stream_Playlist { /** * create_democratic * - * This 'votes' on the songs it inserts them into - * a tmp_playlist with user of -1 (System) + * This 'votes' on the songs; it inserts them into a tmp_playlist with user + * set to -1. */ public function create_democratic() { $democratic = Democratic::get_current_playlist(); $democratic->set_parent(); - $democratic->add_vote($this->urls); + + foreach ($this->urls as $url) { + $data = Stream_URL::parse($url->url); + $democratic->add_vote(array($data['type'], $data['id'])); + } } /** |