fixes #583 - Add vote count to edit page

This commit is contained in:
Luke Pulverenti 2013-10-13 10:37:17 -04:00
parent 7c83e18453
commit f4ce062e0a
4 changed files with 10 additions and 2 deletions

View file

@ -224,6 +224,7 @@ namespace MediaBrowser.Api
item.DisplayMediaType = request.DisplayMediaType; item.DisplayMediaType = request.DisplayMediaType;
item.CommunityRating = request.CommunityRating; item.CommunityRating = request.CommunityRating;
item.VoteCount = request.VoteCount;
item.HomePageUrl = request.HomePageUrl; item.HomePageUrl = request.HomePageUrl;
item.IndexNumber = request.IndexNumber; item.IndexNumber = request.IndexNumber;
item.ParentIndexNumber = request.ParentIndexNumber; item.ParentIndexNumber = request.ParentIndexNumber;

View file

@ -108,6 +108,12 @@ namespace MediaBrowser.Model.Dto
/// <value>The community rating.</value> /// <value>The community rating.</value>
public float? CommunityRating { get; set; } public float? CommunityRating { get; set; }
/// <summary>
/// Gets or sets the vote count.
/// </summary>
/// <value>The vote count.</value>
public int? VoteCount { get; set; }
/// <summary> /// <summary>
/// Gets or sets the original run time ticks. /// Gets or sets the original run time ticks.
/// </summary> /// </summary>

View file

@ -160,7 +160,7 @@ namespace MediaBrowser.Providers.Movies
int voteCount; int voteCount;
if (!string.IsNullOrEmpty(result.imdbVotes) 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) && voteCount >= 0)
{ {
item.VoteCount = voteCount; item.VoteCount = voteCount;
@ -169,7 +169,7 @@ namespace MediaBrowser.Providers.Movies
float imdbRating; float imdbRating;
if (!string.IsNullOrEmpty(result.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) && imdbRating >= 0)
{ {
item.CommunityRating = imdbRating; item.CommunityRating = imdbRating;

View file

@ -905,6 +905,7 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.Type = item.GetType().Name; dto.Type = item.GetType().Name;
dto.CommunityRating = item.CommunityRating; dto.CommunityRating = item.CommunityRating;
dto.VoteCount = item.VoteCount;
if (item.IsFolder) if (item.IsFolder)
{ {