summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorthinca <thinca@gmail.com>2013-05-31 00:26:32 +0900
committerPaul Arthur <paul.arthur@flowerysong.com>2013-05-30 13:14:24 -0400
commit2fa6899f94a18c7ed676ced06427ce8c0cbf4dbe (patch)
tree3f9f85f95ab6b419d5442cda1cdfabc6f3d69ae7 /lib
parentc394d515818e5e68bbadf00782551c9dd01ad17e (diff)
downloadampache-2fa6899f94a18c7ed676ced06427ce8c0cbf4dbe.tar.gz
ampache-2fa6899f94a18c7ed676ced06427ce8c0cbf4dbe.tar.bz2
ampache-2fa6899f94a18c7ed676ced06427ce8c0cbf4dbe.zip
Rating::build_cache: cache the correct value
The structure of the temporary $ratings array changed a while ago, but we were still trying to pull the global rating from the old structure.
Diffstat (limited to 'lib')
-rw-r--r--lib/class/rating.class.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php
index 921211df..4e32b752 100644
--- a/lib/class/rating.class.php
+++ b/lib/class/rating.class.php
@@ -89,7 +89,7 @@ class Rating extends database_object {
while ($row = Dba::fetch_assoc($db_results)) {
$ratings[$row['object_id']] = $row['rating'];
- }
+ }
foreach ($ids as $id) {
// First store the user-specific rating
@@ -106,7 +106,7 @@ class Rating extends database_object {
$rating = 0;
}
else {
- $rating = round($ratings[$id]['rating'], 1);
+ $rating = round($ratings[$id], 1);
}
parent::add_to_cache('rating_' . $type . '_all', $id, $rating);
}