Fix changing a list item's status with no score or progress on MAL
This commit is contained in:
parent
4bd62ce881
commit
59446649f6
@ -1,12 +0,0 @@
|
||||
{
|
||||
"source": {
|
||||
"directories": [
|
||||
"src"
|
||||
]
|
||||
},
|
||||
"timeout": 10,
|
||||
"logs": {
|
||||
"text": "build\/humbuglog.txt",
|
||||
"json": "build\/humbug.json"
|
||||
}
|
||||
}
|
@ -285,7 +285,7 @@ class Model {
|
||||
}
|
||||
|
||||
$transformed = $this->animeTransformer->transform($baseData);
|
||||
$transformed['included'] = $baseData['included'];
|
||||
$transformed['included'] = JsonAPI::organizeIncluded($baseData['included']);
|
||||
return $transformed;
|
||||
}
|
||||
|
||||
|
@ -44,9 +44,7 @@ class AnimeListTransformer extends AbstractTransformer {
|
||||
{
|
||||
$map = [
|
||||
'id' => $item['mal_id'],
|
||||
'data' => [
|
||||
'episode' => $item['data']['progress']
|
||||
]
|
||||
'data' => []
|
||||
];
|
||||
|
||||
$data =& $item['data'];
|
||||
@ -55,6 +53,10 @@ class AnimeListTransformer extends AbstractTransformer {
|
||||
{
|
||||
switch($key)
|
||||
{
|
||||
case 'progress':
|
||||
$map['data']['episode'] = $value;
|
||||
break;
|
||||
|
||||
case 'notes':
|
||||
$map['data']['comments'] = $value;
|
||||
break;
|
||||
|
@ -280,11 +280,11 @@ class Anime extends BaseController {
|
||||
);
|
||||
}
|
||||
|
||||
foreach($data['included'] as $included)
|
||||
if (array_key_exists('characters', $data['included']))
|
||||
{
|
||||
if ($included['type'] === 'characters')
|
||||
foreach($data['included']['characters'] as $id => $character)
|
||||
{
|
||||
$characters[$included['id']] = $included['attributes'];
|
||||
$characters[$id] = $character['attributes'];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user