summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2022-07-29 21:12:35 +0200
committerYorhel <git@yorhel.nl>2022-07-29 21:12:35 +0200
commitba4f0b483ef83a2e3c41c506f8f94d5e06dc0baf (patch)
tree55286c5af230e15f69ceb0497dd93d2f45ada7c1 /lib
parent61e254baa61bae0c77eebc696afc4a3a90bbd224 (diff)
Display staff original name and primary language flag in autocomplete
Diffstat (limited to 'lib')
-rw-r--r--lib/VNWeb/AdvSearch.pm2
-rw-r--r--lib/VNWeb/Elm.pm1
-rw-r--r--lib/VNWeb/Staff/Elm.pm2
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/VNWeb/AdvSearch.pm b/lib/VNWeb/AdvSearch.pm
index 8595518e..8b5343d7 100644
--- a/lib/VNWeb/AdvSearch.pm
+++ b/lib/VNWeb/AdvSearch.pm
@@ -753,7 +753,7 @@ sub elm_search_query {
enrich_merge id => 'SELECT id, name, original, hidden FROM producers WHERE id IN', $o{producers};
$o{staff} = [ map +{id => $_}, grep /^s/, keys %ids ];
- enrich_merge id => 'SELECT s.id, sa.aid, sa.name, sa.original FROM staff s JOIN staff_alias sa ON sa.aid = s.aid WHERE s.id IN', $o{staff};
+ enrich_merge id => 'SELECT s.id, s.lang, sa.aid, sa.name, sa.original FROM staff s JOIN staff_alias sa ON sa.aid = s.aid WHERE s.id IN', $o{staff};
$o{tags} = [ map +{id => $_}, grep /^g/, keys %ids ];
enrich_merge id => 'SELECT id, name, searchable, applicable, hidden, locked FROM tags WHERE id IN', $o{tags};
diff --git a/lib/VNWeb/Elm.pm b/lib/VNWeb/Elm.pm
index f8696239..f6ee14a2 100644
--- a/lib/VNWeb/Elm.pm
+++ b/lib/VNWeb/Elm.pm
@@ -115,6 +115,7 @@ our %apis = (
} } ],
StaffResult => [ { aoh => { # Response to 'Staff'
id => { vndbid => 's' },
+ lang => {},
aid => { id => 1 },
name => {},
original => { required => 0, default => '' },
diff --git a/lib/VNWeb/Staff/Elm.pm b/lib/VNWeb/Staff/Elm.pm
index 5318f458..c95e84fd 100644
--- a/lib/VNWeb/Staff/Elm.pm
+++ b/lib/VNWeb/Staff/Elm.pm
@@ -6,7 +6,7 @@ elm_api Staff => undef, { search => {} }, sub {
my $q = shift->{search};
elm_StaffResult tuwf->dbPagei({ results => 15, page => 1 },
- 'SELECT s.id, sa.aid, sa.name, sa.original
+ 'SELECT s.id, s.lang, sa.aid, sa.name, sa.original
FROM (',
sql_join('UNION ALL',
$q =~ /^$RE{sid}$/ ? sql('SELECT 0, aid FROM staff_alias WHERE id =', \"$+{id}") : (),