Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
3 changed files with 27 additions and 1 deletions
Showing only changes of commit 5357bfb122 - Show all commits

View File

@ -123,7 +123,7 @@ class AnimeListTransformer extends AbstractTransformer {
] ]
]; ];
if (is_numeric($item['user_rating'])) if (is_numeric($item['user_rating']) && $item['user_rating'] > 0)
{ {
$untransformed['data']['rating'] = $item['user_rating'] / 2; $untransformed['data']['rating'] = $item['user_rating'] / 2;
} }

View File

@ -68,6 +68,19 @@ class AnimeListTransformerTest extends AnimeClientTestCase {
'private' => 'On', 'private' => 'On',
'rewatching' => 'On' 'rewatching' => 'On'
] ]
], [
'input' => [
'id' => 14047983,
'mal_id' => '12347',
'watching_status' => 'current',
'user_rating' => 0,
'episodes_watched' => 12,
'rewatched' => 0,
'notes' => '',
'edit' => 'true',
'private' => 'On',
'rewatching' => 'On'
]
]]; ]];
} }

View File

@ -0,0 +1,13 @@
<?php return array (
'id' => 14047983,
'mal_id' => '12347',
'data' =>
array (
'status' => 'current',
'reconsuming' => true,
'reconsumeCount' => 0,
'notes' => '',
'progress' => 12,
'private' => true,
),
);