PersonParser: Member Favorites above 1000 are divided by 1000 because of comma
I don't know exactly what happend but I guess that the MAL website started using a comma for the voice actor member favorites.
I noticed today that quite a famous voice actor 'Park, Romi' had a 'Member Favorites' count of 9 in my database. When I checked on the MAL website, she had a 'Member Favorites' count of 9,937.
A second example 'Sawashiro, Miyuki' had 20 in my database and 20,945 on the MAL website.
In my database, I filtered on my voice actors which still had a favorite count of more than 1000. The latest time of last update is '2017-02-08 21:00:06' so between that time and now there has been a change.
I already solved the bug as per example of the solution in the AnimeParser.
Lines 108-112 should be replaced by the following:
# Favorites count
$extracted = $leftcolumn->filterXPath('//span[text()="Member Favorites:"]');
if ($extracted->count() > 0) {
$extracted = str_replace($extracted->text(), '', $extracted->parents()->text());
//PHP doesn't like commas in integers. Remove it.
$extracted = trim(str_replace(',', '', $extracted));
$personrecord->setFavoritedCount((int) $extracted);
}
I'm curious if other users noticed this phenomenon ...
Comments (3)
-
-
- changed status to resolved
Fix issue
#138- person favorite count truncated due to comma→ <<cset 2cb44c39b458>>
-
Merged in klanchman/atarashii-api/issue-138 (pull request #10)
Fix issue
#138- person favorite count truncated due to commaApproved-by: Ratan Dhawtal ratandhawtal@hotmail.com
→ <<cset 1fe0bd50f0a2>>
- Log in to comment
Kommas are being removed. We should check the $extracted value.