diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-12 06:34:40 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-12 06:34:40 +0000 |
commit | cc9d13a9a29764ce30ecb67dbdec3cc431a95355 (patch) | |
tree | 2c173f6c23dfb8e4335c0b7b9a9e7afcc821cace /lib/class/tmpplaylist.class.php | |
parent | 313e0209d80e28f9beb14cf60d4366fc5c5b0aef (diff) | |
download | ampache-cc9d13a9a29764ce30ecb67dbdec3cc431a95355.tar.gz ampache-cc9d13a9a29764ce30ecb67dbdec3cc431a95355.tar.bz2 ampache-cc9d13a9a29764ce30ecb67dbdec3cc431a95355.zip |
fixed a bug that was causing the entire playlist to be cleared on playback due to a playlist prune
Diffstat (limited to 'lib/class/tmpplaylist.class.php')
-rw-r--r-- | lib/class/tmpplaylist.class.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/class/tmpplaylist.class.php b/lib/class/tmpplaylist.class.php index a9110098..ab55ec58 100644 --- a/lib/class/tmpplaylist.class.php +++ b/lib/class/tmpplaylist.class.php @@ -323,14 +323,17 @@ class tmpPlaylist { */ public static function prune_tracks() { + // This prue is always run clears data for playlists that don't have tmp_playlist anymore $sql = "DELETE FROM tmp_playlist_data USING tmp_playlist_data " . "LEFT JOIN tmp_playlist ON tmp_playlist_data.tmp_playlist=tmp_playlist.id " . "WHERE tmp_playlist.id IS NULL"; $db_results = Dba::query($sql); - + + // This deletes data without votes, if it's a voting democratic playlist $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"; + "LEFT JOIN tmp_playlist ON tmp_playlist.id=tmp_playlist.tmp_playlist " . + "WHERE user_vote.object_id IS NULL AND tmp_playlist.type = 'vote'"; $db_results = Dba::query($sql); return true; |