summaryrefslogtreecommitdiffstats
path: root/lib/class/rating.class.php
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2013-05-13 22:03:52 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2013-05-13 22:13:06 -0400
commitecf095fc0621f369ffcae54a168b43bccf942c2d (patch)
treebcf16f15842cdb01b1791c81beac79c4aea9b729 /lib/class/rating.class.php
parent9a62b49341445f32f2f299f29f3a4340637ba93c (diff)
downloadampache-ecf095fc0621f369ffcae54a168b43bccf942c2d.tar.gz
ampache-ecf095fc0621f369ffcae54a168b43bccf942c2d.tar.bz2
ampache-ecf095fc0621f369ffcae54a168b43bccf942c2d.zip
Fix Rating::gc()
The join was incorrect, sometimes resulting in loss of ratings. Fixes GH #22
Diffstat (limited to 'lib/class/rating.class.php')
-rw-r--r--lib/class/rating.class.php2
1 files changed, 1 insertions, 1 deletions
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");
}
}