diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-12 20:20:08 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-12 20:20:08 +0000 |
commit | 4d053815c552e77ebbab55e9f48bacbea2559cd2 (patch) | |
tree | 543b5623b2a85cff173ab5d563255da3e0253ce3 | |
parent | 85a3474424ec5ea06be2f0f27198c9ba7f739af9 (diff) | |
download | ampache-4d053815c552e77ebbab55e9f48bacbea2559cd2.tar.gz ampache-4d053815c552e77ebbab55e9f48bacbea2559cd2.tar.bz2 ampache-4d053815c552e77ebbab55e9f48bacbea2559cd2.zip |
wups, wasnt cleaning up the playlist of objects with no votes
-rw-r--r-- | lib/class/tmp_playlist.class.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/class/tmp_playlist.class.php b/lib/class/tmp_playlist.class.php index a262f3e8..4172583a 100644 --- a/lib/class/tmp_playlist.class.php +++ b/lib/class/tmp_playlist.class.php @@ -240,7 +240,7 @@ class tmpPlaylist { /** * prune_tracks - * This prunes tracks that don't have playlists + * This prunes tracks that don't have playlists or don't have votes */ function prune_tracks() { @@ -249,6 +249,13 @@ class tmpPlaylist { "WHERE tmp_playlist.id IS NULL"; $db_results = mysql_query($sql,dbh()); + $sql = "DELETE FROM tmp_playlist_data USING tmp_playlist_data " . + "LEFT JOIN user_vote ON tmp_playlist_data.id=user_vote.object_id " . + "WHERE user_vote.object_id IS NULL"; + $db_results = mysql_query($sql,dbh()); + + return true; + } // prune_tracks /** @@ -390,6 +397,9 @@ class tmpPlaylist { "WHERE user='$user_id' AND tmp_playlist_data.object_id='$object_id' " . "AND tmp_playlist_data.tmp_playlist='" . sql_escape($this->id) . "'"; $db_results = mysql_query($sql,dbh()); + + /* Clean up anything that has no votes */ + $this->prune_tracks(); return true; |