Make sure rating parameter sent to Kitsu is greater than 0
This commit is contained in:
parent
b444648a3d
commit
5357bfb122
@ -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;
|
||||
}
|
||||
|
@ -68,6 +68,19 @@ class AnimeListTransformerTest extends AnimeClientTestCase {
|
||||
'private' => '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'
|
||||
]
|
||||
]];
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
),
|
||||
);
|
Loading…
Reference in New Issue
Block a user