diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-25 07:21:45 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-25 07:21:45 +0000 |
commit | 4040d0623dc6c88ee7119dd00244b8800c8e4684 (patch) | |
tree | 0babd4abef3d49cfd64c796a69094e53f1919775 /lib/class/democratic.class.php | |
parent | 608820577f6c5b7cf81860b8bf082285ec01e7f8 (diff) | |
download | ampache-4040d0623dc6c88ee7119dd00244b8800c8e4684.tar.gz ampache-4040d0623dc6c88ee7119dd00244b8800c8e4684.tar.bz2 ampache-4040d0623dc6c88ee7119dd00244b8800c8e4684.zip |
fixed the page reloads once and for all, had to revert to iframe for democratic play and localplay, fixed an adding issue with democratic play if the songs were left in your active playlist
Diffstat (limited to 'lib/class/democratic.class.php')
-rw-r--r-- | lib/class/democratic.class.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/class/democratic.class.php b/lib/class/democratic.class.php index 296ceab9..5b477f80 100644 --- a/lib/class/democratic.class.php +++ b/lib/class/democratic.class.php @@ -142,8 +142,8 @@ class Democratic extends tmpPlaylist { if ($this->base_playlist != '0') { /* We need to pull a random one from the base_playlist */ $base_playlist = new Playlist($this->base_playlist); - $data = $base_playlist->get_random_songs(1); - $results['object_id'] = $data['0']; + $data = $base_playlist->get_random_items(1); + $results['object_id'] = $data['0']['object_id']; } else { $sql = "SELECT `id` as `object_id` FROM `song` WHERE `enabled`='1' ORDER BY RAND() LIMIT 1"; @@ -168,7 +168,6 @@ class Democratic extends tmpPlaylist { $sql = "SELECT `tmp_playlist_data`.`id` FROM `tmp_playlist_data` WHERE `object_type`='$object_type' AND " . "`tmp_playlist`='$tmp_id' AND `object_id`='$object_id'"; -debug_event('foo',$sql,'1'); $db_results = Dba::query($sql); $row = Dba::fetch_assoc($db_results); @@ -237,7 +236,7 @@ debug_event('foo',$sql,'1'); /* If it's on the playlist just vote */ $sql = "SELECT `id` FROM `tmp_playlist_data` " . - "WHERE `tmp_playlist_data`.`object_id`='$object_id'"; + "WHERE `tmp_playlist_data`.`object_id`='$object_id' AND `tmp_playlist_data`.`tmp_playlist`='$tmp_playlist'"; $db_results = Dba::query($sql); /* If it's not there, add it and pull ID */ |