summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/VN.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-09-25 18:37:54 +0200
committerYorhel <git@yorhel.nl>2009-09-25 18:37:54 +0200
commit9ba57996ed6d7fe3dd0d0c1fe5e1b3827b8a2b8a (patch)
tree3c1de7f256c35b1caa833610d27b06923f783fe5 /lib/VNDB/DB/VN.pm
parentfcf1e7f020b267c0efd6f7fd0a973baf682bd075 (diff)
Use inline SVG for relation graphs
The graphs are now stored in the DB in SVG format, the static/rg/ directory can be removed (not used anymore). SVG data is stored using the xml data type, so now I can say for sure you'd need at least PostgreSQL 8.3. This feature still needs some tweaking, though. Current state isn't perfect.
Diffstat (limited to 'lib/VNDB/DB/VN.pm')
-rw-r--r--lib/VNDB/DB/VN.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/DB/VN.pm b/lib/VNDB/DB/VN.pm
index b3603985..c6499350 100644
--- a/lib/VNDB/DB/VN.pm
+++ b/lib/VNDB/DB/VN.pm
@@ -76,7 +76,7 @@ sub dbVNGet {
$o{what} =~ /changes/ ?
'JOIN users u ON u.id = c.requester' : (),
$o{what} =~ /relgraph/ ?
- 'JOIN relgraph rg ON rg.id = v.rgraph' : (),
+ 'JOIN vn_graphs vg ON vg.id = v.rgraph' : (),
);
my $tag_ids = $o{tags_include} && join ',', @{$o{tags_include}[1]};
@@ -86,7 +86,7 @@ sub dbVNGet {
qw|vr.alias vr.image vr.img_nsfw vr.length vr.desc vr.l_wp vr.l_encubed vr.l_renai vr.l_vnn| ) : (),
$o{what} =~ /changes/ ? (
qw|c.requester c.comments v.latest u.username c.rev c.causedby|, q|extract('epoch' from c.added) as added|) : (),
- $o{what} =~ /relgraph/ ? 'rg.cmap' : (),
+ $o{what} =~ /relgraph/ ? 'vg.svg' : (),
$o{what} =~ /ranking/ ? '(SELECT COUNT(*)+1 FROM vn iv WHERE iv.hidden = false AND iv.c_popularity > v.c_popularity) AS ranking' : (),
$tag_ids ?
qq|(SELECT AVG(tvb.rating) FROM tags_vn_bayesian tvb WHERE tvb.tag IN($tag_ids) AND tvb.vid = v.id AND spoiler <= $o{tags_include}[0] GROUP BY tvb.vid) AS tagscore| : (),