Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
Showing only changes of commit cfa23b8066 - Show all commits

View File

@ -64,26 +64,36 @@ class AnimeListTransformer extends AbstractTransformer {
]
];
switch(TRUE)
$data =& $item['data'];
foreach($item['data'] as $key => $value)
{
case array_key_exists('notes', $item['data']):
$map['data']['comments'] = $item['data']['notes'];
switch($key)
{
case 'notes':
$map['data']['comments'] = $value;
break;
case array_key_exists('rating', $item['data']):
$map['data']['score'] = $item['data']['rating'] * 2;
case 'rating':
$map['data']['score'] = $value * 2;
break;
case array_key_exists('reconsuming', $item['data']):
$map['data']['enable_rewatching'] = (bool) $item['data']['reconsuming'];
/* case 'reconsuming':
$map['data']['enable_rewatching'] = (bool) $value;
break;
case array_key_exists('reconsumeCount', $item['data']):
$map['data']['times_rewatched'] = $item['data']['reconsumeCount'];
case 'reconsumeCount':
$map['data']['times_rewatched'] = $value;
break; */
case array_key_exists('status', $item['data']):
$map['data']['status'] = self::statusMap[$item['data']['status']];
case 'status':
$map['data']['status'] = self::statusMap[$value];
break;
default:
break;
}
}
return $map;
}