summaryrefslogtreecommitdiffstats
path: root/lib/class/playlist.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class/playlist.class.php')
-rw-r--r--lib/class/playlist.class.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index fbe2d908..20035f2b 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -52,6 +52,15 @@ class Playlist extends playlist_object {
} // Playlist
/**
+ * gc
+ *
+ * Clean dead items out of playlists
+ */
+ public static function gc() {
+ Dba::write("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'");
+ }
+
+ /**
* build_cache
* This is what builds the cache from the objects
*/