diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-25 21:08:24 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-25 21:45:47 -0500 |
commit | 1069d54c85149ff1cb51563d6a1fc471695f8b47 (patch) | |
tree | e5c22762ef4d6c90dcdb3646a04de26e21ad071c /lib/class/artist.class.php | |
parent | cad1380737f7ffcfa82d46ab3066823435a48a5d (diff) | |
download | ampache-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/artist.class.php')
-rw-r--r-- | lib/class/artist.class.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index 02f8a90a..d4e2df76 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -76,6 +76,15 @@ class Artist extends database_object { } // construct_from_array /** + * gc + * + * This cleans out unused artists + */ + public static function gc() { + Dba::write('DELETE FROM `artist` USING `artist` LEFT JOIN `song` ON `song`.`artist` = `artist`.`id` WHERE `song`.`id` IS NULL'); + } + + /** * this attempts to build a cache of the data from the passed albums all in one query */ public static function build_cache($ids,$extra=false) { @@ -285,7 +294,7 @@ class Artist extends database_object { } $updated = 1; $current_id = $artist_id; - Catalog::clean_artists(); + self::gc(); } // end if it changed if ($updated) { @@ -293,7 +302,8 @@ class Artist extends database_object { Flag::add($song_id,'song','retag','Interface Artist Update'); Song::update_utime($song_id); } - Catalog::clean_stats(); + Stats::gc(); + Rating::gc(); } // if updated return $current_id; |