Make sure rating is only updated if it is numeric
This commit is contained in:
parent
69b4d0c88b
commit
528d3584b8
@ -123,7 +123,7 @@ class AnimeListTransformer extends AbstractTransformer {
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( ! empty($item['user_rating']))
|
if (is_numeric($item['user_rating']))
|
||||||
{
|
{
|
||||||
$untransformed['data']['rating'] = $item['user_rating'] / 2;
|
$untransformed['data']['rating'] = $item['user_rating'] / 2;
|
||||||
}
|
}
|
||||||
|
@ -117,10 +117,14 @@ class MangaListTransformer extends AbstractTransformer {
|
|||||||
'reconsuming' => $rereading,
|
'reconsuming' => $rereading,
|
||||||
'reconsumeCount' => (int)$item['reread_count'],
|
'reconsumeCount' => (int)$item['reread_count'],
|
||||||
'notes' => $item['notes'],
|
'notes' => $item['notes'],
|
||||||
'rating' => $item['new_rating'] / 2
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (is_numeric($item['new_rating']))
|
||||||
|
{
|
||||||
|
$map['data']['rating'] = $item['new_rating'] / 2;
|
||||||
|
}
|
||||||
|
|
||||||
return $map;
|
return $map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user