fixes #511 - Get Imdb rating for tv series using Omdb

This commit is contained in:
Luke Pulverenti 2013-09-02 11:39:09 -04:00
parent 223f1daf33
commit 4785623f6e
3 changed files with 25 additions and 3 deletions

View File

@ -35,6 +35,7 @@ namespace MediaBrowser.Model.Entities
/// Tmdb Collection Id
/// </summary>
TmdbCollection,
MusicBrainzReleaseGroup
MusicBrainzReleaseGroup,
Zap2It
}
}

View File

@ -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>

View File

@ -335,7 +335,27 @@ namespace MediaBrowser.Providers.TV
{
series.Overview = doc.SafeGetString("//Overview");
}
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;