The Free Software Media System - Server Backend & API
fixes #583 - Add vote count to edit page
Luke Pulverentif4ce062e0a77
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.csindex 5d47d08134..ace8c4a6e0 100644--- a/MediaBrowser.Api/ItemUpdateService.cs+++ b/MediaBrowser.Api/ItemUpdateService.cs@@ -224,6 +224,7 @@ namespace MediaBrowser.Apiitem.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.csindex ac25e0177d..22280f6ba8 100644--- a/MediaBrowser.Model/Dto/BaseItemDto.cs+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs@@ -108,6 +108,12 @@ namespace MediaBrowser.Model.Dto/// <value>The community rating.</value>public float? CommunityRating { get; set; }+ /// <summary>+ /// Gets or sets the vote count.+ /// </summary>+ /// <value>The vote count.</value>+ public int? VoteCount { get; set; }+/// <summary>/// Gets or sets the original run time ticks./// </summary>diff --git a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.csindex 35daaf2d25..4356c9e2ea 100644--- a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs+++ b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs@@ -160,7 +160,7 @@ namespace MediaBrowser.Providers.Moviesint 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.Moviesfloat 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.csindex 3c3e01151e..153639a000 100644--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs@@ -905,6 +905,7 @@ namespace MediaBrowser.Server.Implementations.Dtodto.Type = item.GetType().Name;dto.CommunityRating = item.CommunityRating;+ dto.VoteCount = item.VoteCount;if (item.IsFolder){