summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/docs/116
-rw-r--r--data/docs/42
-rw-r--r--lib/VNDB/Handler/Producers.pm16
-rw-r--r--util/updates/update_20180207.sql3
4 files changed, 19 insertions, 8 deletions
diff --git a/data/docs/11 b/data/docs/11
index 72a571e7..77e7cf66 100644
--- a/data/docs/11
+++ b/data/docs/11
@@ -933,7 +933,7 @@ however still required.<br />
<td>details</td>
<td>string</td>
<td>yes</td>
- <td>Comma separated list of alternative names</td>
+ <td>List of alternative names, separated by a newline</td>
</tr>
<tr>
<td>description</td>
@@ -1794,6 +1794,10 @@ Returned members:</p>
Check out the <a href="/t/an">announcements board</a> for more information about updates.
<br /><br />
</p>
+<b>2018-02-07</b>
+<ul>
+ <li>The 'aliases' member for "get producer" is now uses newline as separation rather than a comma</li>
+</ul>
<b>2017-08-14</b>
<ul>
<li>Add 'uid' field to "get votelist/vnlist/wishlist" commands</li>
diff --git a/data/docs/4 b/data/docs/4
index 05d20a56..b30c32c5 100644
--- a/data/docs/4
+++ b/data/docs/4
@@ -30,7 +30,7 @@ while.</p>
If the Name (above) has been romanised, make sure to mention the original (most likely
the Japanese) name here.
</dd><dt>Aliases</dt><dd>
- Other names the producer is known as. Multiple aliases should be separated by a comma.
+ Other names the producer is known as. Multiple aliases should be separated by a newline.
</dd><dt>Primary language</dt><dd>
The language the the producer works in most of the time. By default, it is Japanese.
</dd><dt>Website</dt><dd>
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index a4070467..f78d4336 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -87,7 +87,11 @@ sub page {
h2 class => 'alttitle', $p->{original} if $p->{original};
p class => 'center';
txt "$self->{languages}{$p->{lang}} $self->{producer_types}{$p->{type}}";
- lit '<br />a.k.a. '.html_escape $p->{alias} if $p->{alias};
+ if($p->{alias}) {
+ (my $alias = $p->{alias}) =~ s/\n/, /g;
+ br;
+ txt "a.k.a. $alias";
+ }
my @links = (
$p->{website} ? [ 'Homepage', $p->{website} ] : (),
@@ -219,7 +223,7 @@ sub addform {
if(!$frm->{_err} && !$frm->{continue_ign}) {
$l = $self->dbProducerGet(search => $frm->{name}, what => 'extended', results => 50, inc_hidden => 1);
push @$l, @{$self->dbProducerGet(search => $frm->{original}, what => 'extended', results => 50, inc_hidden => 1)} if $frm->{original};
- $_ && push @$l, @{$self->dbProducerGet(search => $_, what => 'extended', results => 50, inc_hidden => 1)} for(split /\s*,\s*/, $frm->{alias});
+ $_ && push @$l, @{$self->dbProducerGet(search => $_, what => 'extended', results => 50, inc_hidden => 1)} for(split /\n/, $frm->{alias});
my %ids = map +($_->{id}, $_), @$l;
$l = [ map $ids{$_}, sort { $ids{$a}{name} cmp $ids{$b}{name} } keys %ids ];
}
@@ -256,8 +260,8 @@ sub addform {
[ input => name => 'Name (romaji)', short => 'name' ],
[ input => name => 'Original name', short => 'original' ],
[ static => content => 'The original name of the producer, leave blank if it is already in the Latin alphabet.' ],
- [ input => name => 'Aliases', short => 'alias', width => 400 ],
- [ static => content => '(Un)official aliases, separated by a comma.' ],
+ [ textarea => short => 'alias', name => 'Aliases', rows => 4 ],
+ [ static => content => '(Un)official aliases, separated by a newline.' ],
]);
$self->htmlFooter;
}
@@ -342,8 +346,8 @@ sub edit {
[ input => name => 'Name (romaji)', short => 'name' ],
[ input => name => 'Original name', short => 'original' ],
[ static => content => 'The original name of the producer, leave blank if it is already in the Latin alphabet.' ],
- [ input => name => 'Aliases', short => 'alias', width => 400 ],
- [ static => content => '(Un)official aliases, separated by a comma.' ],
+ [ textarea => short => 'alias', name => 'Aliases', rows => 4 ],
+ [ static => content => '(Un)official aliases, separated by a newline.' ],
[ select => name => 'Primary language', short => 'lang',
options => [ map [ $_, "$_ ($self->{languages}{$_})" ], keys %{$self->{languages}} ] ],
[ input => name => 'Website', short => 'website' ],
diff --git a/util/updates/update_20180207.sql b/util/updates/update_20180207.sql
new file mode 100644
index 00000000..99a8be59
--- /dev/null
+++ b/util/updates/update_20180207.sql
@@ -0,0 +1,3 @@
+-- Producer aliases are now separated by newline
+UPDATE producers SET alias = regexp_replace(alias, '\s*,\s*', E'\n', 'g');
+UPDATE producers_hist SET alias = regexp_replace(alias, '\s*,\s*', E'\n', 'g');