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 /// /// The community rating. public float? CommunityRating { get; set; } + + /// + /// Gets or sets the community rating vote count. + /// + /// The community rating vote count. + public int VoteCount { get; set; } + /// /// Gets or sets the run time ticks. /// 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); /// /// 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 @@ -27,11 +27,6 @@ namespace MediaBrowser.Providers.TV /// class RemoteSeriesProvider : BaseMetadataProvider, IDisposable { - /// - /// The _provider manager - /// - private readonly IProviderManager _providerManager; - /// /// The tv db /// @@ -60,10 +55,9 @@ namespace MediaBrowser.Providers.TV /// The HTTP client. /// The log manager. /// The configuration manager. - /// The provider manager. /// The zip client. /// httpClient - 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; }