diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 5d47d0813..ace8c4a6e 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -224,6 +224,7 @@ namespace MediaBrowser.Api item.DisplayMediaType = request.DisplayMediaType; item.CommunityRating = request.CommunityRating; + item.VoteCount = request.VoteCount; item.HomePageUrl = request.HomePageUrl; item.IndexNumber = request.IndexNumber; item.ParentIndexNumber = request.ParentIndexNumber; diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index ac25e0177..22280f6ba 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -108,6 +108,12 @@ namespace MediaBrowser.Model.Dto /// The community rating. public float? CommunityRating { get; set; } + /// + /// Gets or sets the vote count. + /// + /// The vote count. + public int? VoteCount { get; set; } + /// /// Gets or sets the original run time ticks. /// diff --git a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs index 35daaf2d2..4356c9e2e 100644 --- a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs +++ b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs @@ -160,7 +160,7 @@ namespace MediaBrowser.Providers.Movies int voteCount; if (!string.IsNullOrEmpty(result.imdbVotes) - && int.TryParse(result.imdbVotes, NumberStyles.Integer, UsCulture, out voteCount) + && int.TryParse(result.imdbVotes, NumberStyles.Number, UsCulture, out voteCount) && voteCount >= 0) { item.VoteCount = voteCount; @@ -169,7 +169,7 @@ namespace MediaBrowser.Providers.Movies float imdbRating; if (!string.IsNullOrEmpty(result.imdbRating) - && float.TryParse(result.imdbRating, NumberStyles.Number, UsCulture, out imdbRating) + && float.TryParse(result.imdbRating, NumberStyles.Any, UsCulture, out imdbRating) && imdbRating >= 0) { item.CommunityRating = imdbRating; diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 3c3e01151..153639a00 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -905,6 +905,7 @@ namespace MediaBrowser.Server.Implementations.Dto dto.Type = item.GetType().Name; dto.CommunityRating = item.CommunityRating; + dto.VoteCount = item.VoteCount; if (item.IsFolder) {