We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit e9baf996 authored by clint's avatar clint

special-casing of Scrobbles needs to apply to Free_Scrobbles as well

parent dc6ce664
......@@ -39,7 +39,7 @@ class TagCloud {
if (!is_integer($limit)) return false;
$sizes = array('xx-large', 'x-large', 'large', 'medium', 'small', 'x-small', 'xx-small');
$query = "SELECT $field, count(*) AS count FROM $table";
$query .= (!is_null($constraint) || ($table == "Scrobbles")) ? ' WHERE ' : null;
$query .= (!is_null($constraint) || (($table == "Scrobbles") || ($table == "Free_Scrobbles")) ? ' WHERE ' : null;
if ($constrained_field) {
$query .= (!is_null($constraint)) ? " $constrained_field = " . $mdb2->quote($constraint, 'text') : null;
} elseif ($field == "track") {
......@@ -47,8 +47,8 @@ class TagCloud {
} else {
$query .= (!is_null($constraint)) ? ' username = ' . $mdb2->quote($constraint, 'text') : null;
}
$query .= (!is_null($constraint) && ($table == "Scrobbles")) ? ' AND ' : null;
$query .= ($table == "Scrobbles") ? " rating <> 'S' " : null;
$query .= (!is_null($constraint) && (($table == "Scrobbles") || ($table == "Free_Scrobbles")) ? ' AND ' : null;
$query .= (($table == "Scrobbles") || ($table == "Free_Scrobbles")) ? " rating <> 'S' " : null;
$query .= " GROUP BY $field ORDER BY count DESC LIMIT $limit";
$res = $mdb2->query($query);
if (PEAR::isError($res)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment