summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-03-05 20:13:55 +0100
committerYorhel <git@yorhel.nl>2010-03-05 20:13:55 +0100
commit9667c97ca363b2a85a236b5a993561529558053b (patch)
treea58a4e1436454789f1e507e590a049473d4fc830 /lib
parent190d97c714c64a4d579a642c8574cde50996a1d3 (diff)
API: Added image field to 'get vn'
Diffstat (limited to 'lib')
-rw-r--r--lib/Multi/API.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index be1191c6..a30a29b6 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -424,7 +424,7 @@ sub get_vn {
my $select = 'v.id, v.latest';
$select .= ', vr.title, vr.original, v.c_released, v.c_languages::text[], v.c_platforms' if grep /basic/, @{$get->{info}};
- $select .= ', vr.alias AS aliases, vr.length, vr.desc AS description, vr.l_wp, vr.l_encubed, vr.l_renai' if grep /details/, @{$get->{info}};
+ $select .= ', vr.image, vr.alias AS aliases, vr.length, vr.desc AS description, vr.l_wp, vr.l_encubed, vr.l_renai' if grep /details/, @{$get->{info}};
my @placeholders;
my $where = encode_filters $get->{filters}, \&filtertosql, $get->{c}, \@placeholders, [
@@ -496,6 +496,7 @@ sub get_vn_res {
encubed => delete($_->{l_encubed})||undef,
renai => delete($_->{l_renai}) ||undef
};
+ $_->{image} = $_->{image} ? sprintf '%s/cv/%02d/%d.jpg', $VNDB::S{url_static}, $_->{image}%100, $_->{image} : undef;
}
}
$get->{more} = pop(@$res)&&1 if @$res > $_[HEAP]{results};