Ensure we interpret decimal points in ratings properly regardless of culture

This commit is contained in:
Eric Reed 2013-05-28 12:22:38 -04:00
parent feb598c033
commit 61c4d87a16

View File

@ -363,8 +363,8 @@ namespace MediaBrowser.Controller.Providers
if (!string.IsNullOrWhiteSpace(rating))
{
float val;
if (float.TryParse(rating, out val))
// All external meta is saving this as '.' for decimal I believe...but just to be sure
if (float.TryParse(rating.Replace(',','.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out val))
{
item.CommunityRating = val;
}