summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-09-11 19:30:47 +0200
committerYorhel <git@yorhel.nl>2016-09-11 19:30:47 +0200
commit9f7bdb22ec6a68f58fab347c7ab89644c9e9d207 (patch)
tree0c2567ae2e2605f3d11b932841eece9878652a9c /lib
parent8561b6cb5ace9abe6cb1a43f4d3039d5882c4808 (diff)
API: Add VN relations "official" field
Diffstat (limited to 'lib')
-rw-r--r--lib/Multi/API.pm7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index 258189ff..16069ec6 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -385,7 +385,6 @@ my %GET_VN = (
sql => 'SELECT %s FROM vn v WHERE NOT v.hidden AND (%s) %s',
select => 'v.id',
proc => sub {
- delete $_[0]{latest};
$_[0]{id} *= 1
},
sortdef => 'id',
@@ -451,7 +450,7 @@ my %GET_VN = (
]],
},
relations => {
- fetch => [[ 'id', 'SELECT vr.id AS vid, v.id, vr.relation, v.title, v.original FROM vn_relations vr
+ fetch => [[ 'id', 'SELECT vr.id AS vid, v.id, vr.relation, v.title, v.original, vr.official FROM vn_relations vr
JOIN vn v ON v.id = vr.vid WHERE vr.id IN(%s)',
sub { my($r, $n) = @_;
for my $i (@$r) {
@@ -460,6 +459,7 @@ my %GET_VN = (
for (@$n) {
$_->{id} *= 1;
$_->{original} ||= undef;
+ $_->{official} = $_->{official} =~ /t/ ? TRUE : FALSE,
delete $_->{vid};
}
}
@@ -555,7 +555,6 @@ my %GET_RELEASE = (
released => 'r.released %s',
},
proc => sub {
- delete $_[0]{latest};
$_[0]{id} *= 1
},
flags => {
@@ -685,7 +684,6 @@ my %GET_PRODUCER = (
sql => 'SELECT %s FROM producers p WHERE NOT p.hidden AND (%s) %s',
select => 'p.id',
proc => sub {
- delete $_[0]{latest};
$_[0]{id} *= 1
},
sortdef => 'id',
@@ -759,7 +757,6 @@ my %GET_CHARACTER = (
sql => 'SELECT %s FROM chars c WHERE NOT c.hidden AND (%s) %s',
select => 'c.id',
proc => sub {
- delete $_[0]{latest};
$_[0]{id} *= 1
},
sortdef => 'id',