summaryrefslogtreecommitdiffstats
path: root/lib/class/song.class.php
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2013-01-25 21:08:24 -0500
committerPaul Arthur <paul.arthur@flowerysong.com>2013-01-25 21:45:47 -0500
commit1069d54c85149ff1cb51563d6a1fc471695f8b47 (patch)
treee5c22762ef4d6c90dcdb3646a04de26e21ad071c /lib/class/song.class.php
parentcad1380737f7ffcfa82d46ab3066823435a48a5d (diff)
downloadampache-1069d54c85149ff1cb51563d6a1fc471695f8b47.tar.gz
ampache-1069d54c85149ff1cb51563d6a1fc471695f8b47.tar.bz2
ampache-1069d54c85149ff1cb51563d6a1fc471695f8b47.zip
Move clean functions into their respective classes
Uniformly name them gc()
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r--lib/class/song.class.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 72ab88f9..8e48f87c 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -75,6 +75,15 @@ class Song extends database_object implements media {
} // constructor
/**
+ * gc
+ *
+ * Cleans up the song_data table
+ */
+ public static function gc() {
+ Dba::write('DELETE FROM `song_data` USING `song_data` LEFT JOIN `song` ON `song`.`id` = `song_data`.`song_id` WHERE `song`.`id` IS NULL');
+ }
+
+ /**
* build_cache
*
* This attempts to reduce queries by asking for everything in the