diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-10 05:24:59 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-10 05:24:59 +0000 |
commit | 311ac991126f68b12a6a29747091544de4acf6a1 (patch) | |
tree | 3e52ca25f8ba905e635c996cf31eafaff599ddde /lib/class/catalog.class.php | |
parent | 01a5512c04512a0d08d8de05705d87d6c9fe46d3 (diff) | |
download | ampache-311ac991126f68b12a6a29747091544de4acf6a1.tar.gz ampache-311ac991126f68b12a6a29747091544de4acf6a1.tar.bz2 ampache-311ac991126f68b12a6a29747091544de4acf6a1.zip |
minor fixes to the playlist, fixed up the democratic playlist kinda, still does not work completely
Diffstat (limited to 'lib/class/catalog.class.php')
-rw-r--r-- | lib/class/catalog.class.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 0b152458..02e780e8 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -1582,11 +1582,13 @@ class Catalog { public static function clean_playlists() { /* Do a complex delete to get playlist songs where there are no songs */ - $sql = "DELETE FROM playlist_data USING playlist_data LEFT JOIN song ON song.id = playlist_data.song WHERE song.file IS NULL"; + $sql = "DELETE FROM `playlist_data` USING `playlist_data` LEFT JOIN `song` ON `song`.`id` = `playlist_data`.`object_id` " . + "WHERE `song`.`file` IS NULL AND `playlist_data`.`object_type`='song'"; $db_results = Dba::query($sql); // Clear TMP Playlist information as well - $sql = "DELETE FROM tmp_playlist_data USING tmp_playlist_data LEFT JOIN song ON tmp_playlist_data.object_id = song.id WHERE song.id IS NULL"; + $sql = "DELETE FROM `tmp_playlist_data` USING `tmp_playlist_data` LEFT JOIN `song` ON `tmp_playlist_data`.`object_id` = `song`.`id` " . + "WHERE `song`.`id` IS NULL"; $db_results = Dba::query($sql); } // clean_playlists |