diff options
author | Yorhel <git@yorhel.nl> | 2011-02-05 18:33:55 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2011-02-05 18:33:55 +0100 |
commit | bccc7326a43020e44aea345b803adaceaa90f2a2 (patch) | |
tree | 2efd0a89131865c616960f76771429893145c3d5 /lib/VNDB/DB/Tags.pm | |
parent | 99b0bb54556d4300676056e8afe606d859e6417b (diff) |
Group tags on /v+/tagmod by their category
Diffstat (limited to 'lib/VNDB/DB/Tags.pm')
-rw-r--r-- | lib/VNDB/DB/Tags.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm index a4451f98..8ed4cec6 100644 --- a/lib/VNDB/DB/Tags.pm +++ b/lib/VNDB/DB/Tags.pm @@ -249,13 +249,13 @@ sub dbTagStats { }->{ $o{sort}||'name' }, $o{reverse} ? 'DESC' : 'ASC'; my($r, $np) = $self->dbPage(\%o, qq| - SELECT t.id, t.name, count(*) as cnt, $rating as rating, + SELECT t.id, t.name, t.cat, count(*) as cnt, $rating as rating, COALESCE(avg(CASE WHEN tv.ignore THEN NULL ELSE tv.spoiler END), 0) as spoiler, bool_or(tv.ignore) AS overruled FROM tags t JOIN tags_vn tv ON tv.tag = t.id WHERE tv.vid = ? - GROUP BY t.id, t.name + GROUP BY t.id, t.name, t.cat !s ORDER BY !s|, $o{vid}, defined $o{minrating} ? "HAVING $rating > $o{minrating}" : '', $order |