|
@@ -66,28 +66,24 @@ namespace MediaBrowser.Providers.Omdb
|
|
|
item.ProductionYear = year;
|
|
|
}
|
|
|
|
|
|
- var hasCriticRating = item as IHasCriticRating;
|
|
|
- if (hasCriticRating != null)
|
|
|
- {
|
|
|
- // Seeing some bogus RT data on omdb for series, so filter it out here
|
|
|
- // RT doesn't even have tv series
|
|
|
- int tomatoMeter;
|
|
|
+ // Seeing some bogus RT data on omdb for series, so filter it out here
|
|
|
+ // RT doesn't even have tv series
|
|
|
+ int tomatoMeter;
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(result.tomatoMeter)
|
|
|
- && int.TryParse(result.tomatoMeter, NumberStyles.Integer, _usCulture, out tomatoMeter)
|
|
|
- && tomatoMeter >= 0)
|
|
|
- {
|
|
|
- hasCriticRating.CriticRating = 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, "No consensus yet.", StringComparison.OrdinalIgnoreCase))
|
|
|
- {
|
|
|
- hasCriticRating.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (!string.IsNullOrEmpty(result.tomatoConsensus)
|
|
|
+ && !string.Equals(result.tomatoConsensus, "No consensus yet.", StringComparison.OrdinalIgnoreCase))
|
|
|
+ {
|
|
|
+ item.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
|
|
+ }
|
|
|
|
|
|
- int voteCount;
|
|
|
+ int voteCount;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(result.imdbVotes)
|
|
|
&& int.TryParse(result.imdbVotes, NumberStyles.Number, _usCulture, out voteCount)
|
|
@@ -167,25 +163,21 @@ namespace MediaBrowser.Providers.Omdb
|
|
|
item.ProductionYear = year;
|
|
|
}
|
|
|
|
|
|
- var hasCriticRating = item as IHasCriticRating;
|
|
|
- if (hasCriticRating != null)
|
|
|
- {
|
|
|
- // Seeing some bogus RT data on omdb for series, so filter it out here
|
|
|
- // RT doesn't even have tv series
|
|
|
- int tomatoMeter;
|
|
|
+ // Seeing some bogus RT data on omdb for series, so filter it out here
|
|
|
+ // RT doesn't even have tv series
|
|
|
+ int tomatoMeter;
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(result.tomatoMeter)
|
|
|
- && int.TryParse(result.tomatoMeter, NumberStyles.Integer, _usCulture, out tomatoMeter)
|
|
|
- && tomatoMeter >= 0)
|
|
|
- {
|
|
|
- hasCriticRating.CriticRating = 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, "No consensus yet.", StringComparison.OrdinalIgnoreCase))
|
|
|
- {
|
|
|
- hasCriticRating.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
|
|
- }
|
|
|
+ if (!string.IsNullOrEmpty(result.tomatoConsensus)
|
|
|
+ && !string.Equals(result.tomatoConsensus, "No consensus yet.", StringComparison.OrdinalIgnoreCase))
|
|
|
+ {
|
|
|
+ item.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
|
|
}
|
|
|
|
|
|
int voteCount;
|
|
@@ -420,12 +412,8 @@ namespace MediaBrowser.Providers.Omdb
|
|
|
hasAwards.AwardSummary = WebUtility.HtmlDecode(result.Awards);
|
|
|
}
|
|
|
|
|
|
- var hasShortOverview = item as IHasShortOverview;
|
|
|
- if (hasShortOverview != null)
|
|
|
- {
|
|
|
- // Imdb plots are usually pretty short
|
|
|
- hasShortOverview.ShortOverview = result.Plot;
|
|
|
- }
|
|
|
+ // Imdb plots are usually pretty short
|
|
|
+ item.ShortOverview = result.Plot;
|
|
|
|
|
|
//if (!string.IsNullOrWhiteSpace(result.Director))
|
|
|
//{
|