|
@@ -25,10 +25,15 @@ if ($Cache->get_value('anidb_json_'.$aid)) {
|
25
|
25
|
json_die("failure", $anidb_xml->xpath('/error')[0]."");
|
26
|
26
|
}
|
27
|
27
|
|
28
|
|
- $title = $anidb_xml->xpath('//titles/title[@type = "main"]')[0].'';
|
29
|
|
- $title = (empty($title))?$anidb_xml->xpath('//titles/title[@xml:lang = "en" and @type = "official"]')[0].'':$title;
|
|
28
|
+ $title = $anidb_xml->xpath('//titles/title[@xml:lang = "en" and @type = "official"]')[0].'';
|
|
29
|
+ $title = (empty($title))?$anidb_xml->xpath('//titles/title[@xml:lang = "en"]')[0].'':$title;
|
|
30
|
+ $title = (empty($title))?$anidb_xml->xpath('//titles/title[@type = "main"]')[0].'':$title;
|
|
31
|
+
|
|
32
|
+ $title_rj = $anidb_xml->xpath('//titles/title[@xml:lang = "x-jat" and @type = "official"]')[0].'';
|
|
33
|
+ $title_rj = (empty($title_rj))?$anidb_xml->xpath('//titles/title[@xml:lang = "x-jat"]')[0].'':$title_rj;
|
30
|
34
|
|
31
|
35
|
$title_jp = $anidb_xml->xpath('//titles/title[@xml:lang = "ja" and @type = "official"]')[0].'';
|
|
36
|
+ $title_jp = (empty($title_jp))?$anidb_xml->xpath('//titles/title[@xml:lang = "ja"]')[0].'':$title_jp;
|
32
|
37
|
|
33
|
38
|
$artist = $anidb_xml->xpath('//creators/name[@type = "Animation Work"]')[0].'';
|
34
|
39
|
|
|
@@ -39,6 +44,7 @@ if ($Cache->get_value('anidb_json_'.$aid)) {
|
39
|
44
|
$json_str = array(
|
40
|
45
|
'id' => $aid,
|
41
|
46
|
'title' => $title,
|
|
47
|
+ 'title_rj' => $title_rj,
|
42
|
48
|
'title_jp' => $title_jp,
|
43
|
49
|
'artist' => $artist,
|
44
|
50
|
'year' => $year,
|