Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[videoinfotag] Avoid overwriting valid "default" rating with invalid data on scraper parse. #8889

Merged
merged 1 commit into from
Jan 19, 2016

Conversation

anaconda
Copy link
Contributor

With online scrapers (but not with NFO files) ParseNative gets called multiple
times, so avoid adding a "default" rating every time it's called as we may have a valid one already.

See http://forum.kodi.tv/showthread.php?tid=238393&pid=2217024#pid2217024

@phate89 your opinion?

@anaconda anaconda added Type: Fix non-breaking change which fixes an issue v17 Krypton labels Jan 16, 2016
@anaconda anaconda changed the title [videoinfotag] Avoid overwriting rating with garbage on parse. [videoinfotag] Avoid overwriting valid "default" rating with invalid data on scraper parse. Jan 17, 2016
@phate89
Copy link
Contributor

phate89 commented Jan 17, 2016

The fix it's ok.
Maybe you could add a float variable (where we create the node one) and use XMLUtils::GetFloat directly to check if it exists in the else if. Not sure what's best.
Thanks for the fix btw..

@anaconda
Copy link
Contributor Author

Up to you.
My first approach was indeed to use GetFloat, but then decided I didn't like it.

@phate89
Copy link
Contributor

phate89 commented Jan 18, 2016

It's probably better to allocate a float variable that we might not use than do an xml parse twice..

With online scrapers (but not with NFO files) ParseNative gets called multiple
times, so avoid adding a "default" rating every time it's called.

See http://forum.kodi.tv/showthread.php?tid=238393&pid=2217024#pid2217024
@anaconda
Copy link
Contributor Author

Updated.
@phate89 please merge if happy.
jenkins build this please

phate89 added a commit that referenced this pull request Jan 19, 2016
[videoinfotag] Avoid overwriting valid "default" rating with invalid data on scraper parse.
@phate89 phate89 merged commit ddd3359 into xbmc:master Jan 19, 2016
@phate89
Copy link
Contributor

phate89 commented Jan 19, 2016

merged. Thanks @anaconda

@anaconda anaconda deleted the 8080-fix-overwrite branch January 20, 2016 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Fix non-breaking change which fixes an issue v17 Krypton
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants