Skip to content

Commit

Permalink
Merge pull request xbmc#10014 from notspiff/fix_album_userrating
Browse files Browse the repository at this point in the history
fixed: i think this was supposed to be 10. cut-and-paste ftw
  • Loading branch information
MartijnKaijser authored Jun 20, 2016
2 parents 9b31219 + 2f8b539 commit 50ca59b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xbmc/music/Album.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ bool CAlbum::Load(const TiXmlElement *album, bool append, bool prioritise)
float max_rating = 10;
XMLUtils::GetFloat(album, "userrating", rating);
if (userrating->QueryFloatAttribute("max", &max_rating) == TIXML_SUCCESS && max_rating >= 1)
rating *= (5.f / max_rating); // Normalise the Rating to between 0 and 10
if (rating > 5.f)
rating = 5.f;
rating *= (10.f / max_rating); // Normalise the Rating to between 0 and 10
if (rating > 10.f)
rating = 10.f;
iUserrating = MathUtils::round_int(rating);
}
XMLUtils::GetInt(album, "votes", iVotes);
Expand Down

0 comments on commit 50ca59b

Please sign in to comment.