Fix changing a list item's status with no score or progress on MAL

This commit is contained in:
Timothy Warren 2017-04-11 09:28:07 -04:00
parent 679560e185
commit 5cca3cf335
4 changed files with 9 additions and 19 deletions

View File

@ -1,12 +0,0 @@
{
"source": {
"directories": [
"src"
]
},
"timeout": 10,
"logs": {
"text": "build\/humbuglog.txt",
"json": "build\/humbug.json"
}
}

View File

@ -285,7 +285,7 @@ class Model {
} }
$transformed = $this->animeTransformer->transform($baseData); $transformed = $this->animeTransformer->transform($baseData);
$transformed['included'] = $baseData['included']; $transformed['included'] = JsonAPI::organizeIncluded($baseData['included']);
return $transformed; return $transformed;
} }

View File

@ -44,9 +44,7 @@ class AnimeListTransformer extends AbstractTransformer {
{ {
$map = [ $map = [
'id' => $item['mal_id'], 'id' => $item['mal_id'],
'data' => [ 'data' => []
'episode' => $item['data']['progress']
]
]; ];
$data =& $item['data']; $data =& $item['data'];
@ -55,6 +53,10 @@ class AnimeListTransformer extends AbstractTransformer {
{ {
switch($key) switch($key)
{ {
case 'progress':
$map['data']['episode'] = $value;
break;
case 'notes': case 'notes':
$map['data']['comments'] = $value; $map['data']['comments'] = $value;
break; break;

View File

@ -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'];
} }
} }