mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #511 - Get Imdb rating for tv series using Omdb
This commit is contained in:
parent
765884efb4
commit
35f755cce3
@ -149,13 +149,25 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
{
|
{
|
||||||
var result = JsonSerializer.DeserializeFromStream<RootObject>(stream);
|
var result = JsonSerializer.DeserializeFromStream<RootObject>(stream);
|
||||||
|
|
||||||
int tomatoMeter;
|
// Seeing some bogus RT data on omdb for series, so filter it out here
|
||||||
|
// RT doesn't even have tv series
|
||||||
if (!string.IsNullOrEmpty(result.tomatoMeter)
|
if (!(item is Series))
|
||||||
&& int.TryParse(result.tomatoMeter, NumberStyles.Integer, UsCulture, out tomatoMeter)
|
|
||||||
&& tomatoMeter >= 0)
|
|
||||||
{
|
{
|
||||||
item.CriticRating = tomatoMeter;
|
int tomatoMeter;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(result.tomatoMeter)
|
||||||
|
&& int.TryParse(result.tomatoMeter, NumberStyles.Integer, UsCulture, out tomatoMeter)
|
||||||
|
&& tomatoMeter >= 0)
|
||||||
|
{
|
||||||
|
item.CriticRating = tomatoMeter;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(result.tomatoConsensus)
|
||||||
|
&& !string.Equals(result.tomatoConsensus, "n/a", StringComparison.OrdinalIgnoreCase)
|
||||||
|
&& !string.Equals(result.tomatoConsensus, "No consensus yet.", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
item.CriticRatingSummary = result.tomatoConsensus;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int voteCount;
|
int voteCount;
|
||||||
@ -175,13 +187,6 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
{
|
{
|
||||||
item.CommunityRating = imdbRating;
|
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))
|
|
||||||
{
|
|
||||||
item.CriticRatingSummary = result.tomatoConsensus;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data.LastRefreshStatus = ProviderRefreshStatus.Success;
|
data.LastRefreshStatus = ProviderRefreshStatus.Success;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user