summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-11-14 11:58:07 +0100
committerYorhel <git@yorhel.nl>2009-11-14 11:58:07 +0100
commit848cae8e13d6ab8110caff39acf671822659de08 (patch)
treebb83d30f8fbbbbcf6345238859a5b01cc5dd3dca
parent537bba22c0ed0c0fe52ba067f136b30e7f95d968 (diff)
API: Changed 'website' member of get producer to a links object
Which also covers the wikipedia link, and possibly more in the future.
-rw-r--r--data/docs/1113
-rw-r--r--lib/Multi/API.pm7
2 files changed, 14 insertions, 6 deletions
diff --git a/data/docs/11 b/data/docs/11
index 7340319f..f1c84dce 100644
--- a/data/docs/11
+++ b/data/docs/11
@@ -740,11 +740,16 @@ however still required.<br />
<td>Primary language</td>
</tr>
<tr>
- <td>website</td>
+ <td>links</td>
<td>details</td>
- <td>string</td>
- <td>yes</td>
- <td>Official website URL</td>
+ <td>object</td>
+ <td>no</td>
+ <td>
+ External links, object has the following members:<br />
+ "homepage", official homepage,<br />
+ "wikipedia", title of the related article on the English wikipedia.<br />
+ Both values can be <b>null</b>.
+ </td>
</tr>
<tr class="odd">
<td>aliases</td>
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index 8da59de6..8014f9be 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -719,7 +719,7 @@ sub get_producer {
my $select = 'p.id, p.latest';
$select .= ', pr.type, pr.name, pr.original, pr.lang AS language' if grep /basic/, @{$get->{info}};
- $select .= ', pr.website, pr.desc AS description, pr.alias AS aliases' if grep /details/, @{$get->{info}};
+ $select .= ', pr.website, pr.l_wp, pr.desc AS description, pr.alias AS aliases' if grep /details/, @{$get->{info}};
my @placeholders;
my $where = encode_filters $get->{filters}, \&filtertosql, $get->{c}, \@placeholders, [
@@ -767,7 +767,10 @@ sub get_producer_res {
$_->{id}*=1;
$_->{original} ||= undef if grep /basic/, @{$get->{info}};
if(grep /details/, @{$get->{info}}) {
- $_->{website} ||= undef;
+ $_->{links} = {
+ homepage => delete($_->{website})||undef,
+ wikipedia => delete $_->{l_wp},
+ };
$_->{description} ||= undef;
$_->{aliases} ||= undef;
}