From f435ca753c1d6ce8f657c3374ae71daec6daf2be Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 12 Nov 2007 07:36:52 +0000 Subject: more democratic play work, still not working going to need db change to make it work how I want, will do later --- lib/class/democratic.class.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'lib/class/democratic.class.php') diff --git a/lib/class/democratic.class.php b/lib/class/democratic.class.php index f1955aed..276a74e1 100644 --- a/lib/class/democratic.class.php +++ b/lib/class/democratic.class.php @@ -22,20 +22,9 @@ /** * Democratic * This class handles democratic play, which is a fancy - * name for voting based playback. This uses the tmp playlist - * heavily + * name for voting based playback. This extends the tmpplaylist */ -class Democratic { - - /** - * Constructor - * This doesn't do anything currently - */ - public function __construct() { - - return true; - - } // Constructor +class Democratic extends tmpPlaylist { /** * get_playlists @@ -44,7 +33,19 @@ class Democratic { */ public static function get_playlists() { + // Pull all tmp playlsits with a session of < 0 (as those are fake) + // This is kind of hackish, should really think about tweaking the db + // and doing this right. + $sql = "SELECT `id` FROM `tmp_playlist` WHERE `session`< '0'"; + $db_results = Dba::query($sql); + + $results = array(); + + while ($row = Dba::fetch_assoc($db_results)) { + $results[] = $row['id']; + } + return $results; } // get_playlists -- cgit