diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-24 21:57:08 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-24 21:57:08 +0000 |
commit | cafe91fd5d5c2cff199758246e8a3bcd7dc77e79 (patch) | |
tree | 5bf1905fd9acdef9f605f0e04b46f755821fb209 | |
parent | 6e299a7f63b5b5f056667dee6788fe4c5626be5f (diff) | |
download | ampache-cafe91fd5d5c2cff199758246e8a3bcd7dc77e79.tar.gz ampache-cafe91fd5d5c2cff199758246e8a3bcd7dc77e79.tar.bz2 ampache-cafe91fd5d5c2cff199758246e8a3bcd7dc77e79.zip |
really fixed the non-removal of played songs this time
-rw-r--r-- | lib/class/democratic.class.php | 3 | ||||
-rw-r--r-- | play/index.php | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/class/democratic.class.php b/lib/class/democratic.class.php index aa908a65..296ceab9 100644 --- a/lib/class/democratic.class.php +++ b/lib/class/democratic.class.php @@ -168,6 +168,7 @@ 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); @@ -188,7 +189,7 @@ class Democratic extends tmpPlaylist { /* Itterate through the objects if no vote, add to playlist and vote */ foreach ($items as $type=>$object_id) { //FIXME: This is a hack until we fix everything else - if (intval($type)) { $type = 'song'; } + if (intval($type) == $type) { $type = 'song'; } if (!$this->has_vote($object_id,$type)) { $this->add_vote($object_id,$type); } diff --git a/play/index.php b/play/index.php index 204b0021..2030c3ff 100644 --- a/play/index.php +++ b/play/index.php @@ -296,8 +296,9 @@ if ($bytesStreamed > $minBytesStreamed) { $user->update_stats($song->id); /* If this is a voting tmp playlist remove the entry */ - if (is_object($democratic)) { + if ($demo_id) { $row_id = $democratic->get_uid_from_object_id($song_id,'song'); + debug_event('Democratic','Removing Song Entry from Democratic Playlist','1'); $democratic->delete_votes($row_id); } // if tmp_playlist |