mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
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
|
/// Tmdb Collection Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TmdbCollection,
|
TmdbCollection,
|
||||||
MusicBrainzReleaseGroup
|
MusicBrainzReleaseGroup,
|
||||||
|
Zap2It
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.Movies;
|
using MediaBrowser.Controller.Entities.Movies;
|
||||||
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
@ -98,7 +99,7 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
return !trailer.IsLocalTrailer;
|
return !trailer.IsLocalTrailer;
|
||||||
}
|
}
|
||||||
|
|
||||||
return item is Movie || item is MusicVideo;
|
return item is Movie || item is MusicVideo || item is Series;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -335,7 +335,27 @@ namespace MediaBrowser.Providers.TV
|
|||||||
{
|
{
|
||||||
series.Overview = doc.SafeGetString("//Overview");
|
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.CommunityRating = doc.SafeGetSingle("//Rating", 0, 10);
|
||||||
|
}
|
||||||
|
|
||||||
series.AirDays = TVUtils.GetAirDays(doc.SafeGetString("//Airs_DayOfWeek"));
|
series.AirDays = TVUtils.GetAirDays(doc.SafeGetString("//Airs_DayOfWeek"));
|
||||||
series.AirTime = doc.SafeGetString("//Airs_Time");
|
series.AirTime = doc.SafeGetString("//Airs_Time");
|
||||||
SeriesStatus seriesStatus;
|
SeriesStatus seriesStatus;
|
||||||
|
Loading…
Reference in New Issue
Block a user