fixes #511 - Get Imdb rating for tv series using Omdb
This commit is contained in:
parent
223f1daf33
commit
4785623f6e
|
@ -35,6 +35,7 @@ namespace MediaBrowser.Model.Entities
|
|||
/// Tmdb Collection Id
|
||||
/// </summary>
|
||||
TmdbCollection,
|
||||
MusicBrainzReleaseGroup
|
||||
MusicBrainzReleaseGroup,
|
||||
Zap2It
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
@ -98,7 +99,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
return !trailer.IsLocalTrailer;
|
||||
}
|
||||
|
||||
return item is Movie || item is MusicVideo;
|
||||
return item is Movie || item is MusicVideo || item is Series;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -335,7 +335,27 @@ namespace MediaBrowser.Providers.TV
|
|||
{
|
||||
series.Overview = doc.SafeGetString("//Overview");
|
||||
}
|
||||
series.CommunityRating = doc.SafeGetSingle("//Rating", 0, 10);
|
||||
|
||||
var imdbId = doc.SafeGetString("//IMDB_ID");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(imdbId))
|
||||
{
|
||||
series.SetProviderId(MetadataProviders.Imdb, imdbId);
|
||||
}
|
||||
|
||||
var zap2ItId = doc.SafeGetString("//zap2it_id");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(zap2ItId))
|
||||
{
|
||||
series.SetProviderId(MetadataProviders.Zap2It, zap2ItId);
|
||||
}
|
||||
|
||||
// Only fill this if it doesn't already have a value, since we get it from imdb which has better data
|
||||
if (!series.CommunityRating.HasValue || string.IsNullOrWhiteSpace(series.GetProviderId(MetadataProviders.Imdb)))
|
||||
{
|
||||
series.CommunityRating = doc.SafeGetSingle("//Rating", 0, 10);
|
||||
}
|
||||
|
||||
series.AirDays = TVUtils.GetAirDays(doc.SafeGetString("//Airs_DayOfWeek"));
|
||||
series.AirTime = doc.SafeGetString("//Airs_Time");
|
||||
SeriesStatus seriesStatus;
|
||||
|
|
Loading…
Reference in New Issue
Block a user