diff options
4 files changed, 30 insertions, 9 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 94fcd250e..dff0203b9 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -575,6 +575,13 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The community rating.</value> public float? CommunityRating { get; set; } + + /// <summary> + /// Gets or sets the community rating vote count. + /// </summary> + /// <value>The community rating vote count.</value> + public int VoteCount { get; set; } + /// <summary> /// Gets or sets the run time ticks. /// </summary> diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.cs index 64259c424..0763c63bb 100644 --- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs @@ -679,11 +679,14 @@ namespace MediaBrowser.Providers.Movies float rating; string voteAvg = movieData.vote_average.ToString(CultureInfo.InvariantCulture); + //tmdb appears to have unified their numbers to always report "7.3" regardless of country // so I removed the culture-specific processing here because it was not working for other countries -ebr if (float.TryParse(voteAvg, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out rating)) movie.CommunityRating = rating; + movie.VoteCount = movieData.vote_count; + //release date and certification are retrieved based on configured country and we fall back on US if not there and to minimun release date if still no match if (movieData.releases != null && movieData.releases.countries != null) { diff --git a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs index 6cbc8bcdf..0d701aff8 100644 --- a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs +++ b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs @@ -15,7 +15,7 @@ namespace MediaBrowser.Providers.Movies { public class OpenMovieDatabaseProvider : BaseMetadataProvider { - private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(2, 2); + private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(1, 1); /// <summary> /// Gets the json serializer. @@ -157,6 +157,24 @@ namespace MediaBrowser.Providers.Movies item.CriticRating = tomatoMeter; } + int voteCount; + + if (!string.IsNullOrEmpty(result.imdbVotes) + && int.TryParse(result.imdbVotes, NumberStyles.Integer, UsCulture, out voteCount) + && voteCount >= 0) + { + item.VoteCount = voteCount; + } + + float imdbRating; + + if (!string.IsNullOrEmpty(result.imdbRating) + && float.TryParse(result.imdbRating, NumberStyles.Number, UsCulture, out imdbRating) + && imdbRating >= 0) + { + item.CommunityRating = imdbRating; + } + if (!string.IsNullOrEmpty(result.tomatoConsensus) && !string.Equals(result.tomatoConsensus, "n/a", StringComparison.OrdinalIgnoreCase) && !string.Equals(result.tomatoConsensus, "No consensus yet.", StringComparison.OrdinalIgnoreCase)) diff --git a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs index 3d86ebb7e..92efdeb39 100644 --- a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs @@ -28,11 +28,6 @@ namespace MediaBrowser.Providers.TV class RemoteSeriesProvider : BaseMetadataProvider, IDisposable { /// <summary> - /// The _provider manager - /// </summary> - private readonly IProviderManager _providerManager; - - /// <summary> /// The tv db /// </summary> internal readonly SemaphoreSlim TvDbResourcePool = new SemaphoreSlim(2, 2); @@ -60,10 +55,9 @@ namespace MediaBrowser.Providers.TV /// <param name="httpClient">The HTTP client.</param> /// <param name="logManager">The log manager.</param> /// <param name="configurationManager">The configuration manager.</param> - /// <param name="providerManager">The provider manager.</param> /// <param name="zipClient">The zip client.</param> /// <exception cref="System.ArgumentNullException">httpClient</exception> - public RemoteSeriesProvider(IHttpClient httpClient, ILogManager logManager, IServerConfigurationManager configurationManager, IProviderManager providerManager, IZipClient zipClient) + public RemoteSeriesProvider(IHttpClient httpClient, ILogManager logManager, IServerConfigurationManager configurationManager, IZipClient zipClient) : base(logManager, configurationManager) { if (httpClient == null) @@ -71,7 +65,6 @@ namespace MediaBrowser.Providers.TV throw new ArgumentNullException("httpClient"); } HttpClient = httpClient; - _providerManager = providerManager; _zipClient = zipClient; Current = this; } |
