From ecf095fc0621f369ffcae54a168b43bccf942c2d Mon Sep 17 00:00:00 2001 From: Paul Arthur Date: Mon, 13 May 2013 22:03:52 -0400 Subject: Fix Rating::gc() The join was incorrect, sometimes resulting in loss of ratings. Fixes GH #22 --- lib/class/rating.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/class') diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index 1e983d42..921211df 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -55,7 +55,7 @@ class Rating extends database_object { */ public static function gc() { foreach(array('song', 'album', 'artist', 'video') as $object_type) { - Dba::write("DELETE FROM `rating` USING `rating` LEFT JOIN `$object_type` ON `$object_type`.`id` = `rating`.`object_type` WHERE `object_type` = '$object_type' AND `$object_type`.`id` IS NULL"); + Dba::write("DELETE FROM `rating` USING `rating` LEFT JOIN `$object_type` ON `$object_type`.`id` = `rating`.`object_id` WHERE `object_type` = '$object_type' AND `$object_type`.`id` IS NULL"); } } -- cgit