|
|
@ -162,8 +162,9 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|
|
|
|
|
|
|
|
|
|
|
movie.TitleSlug += "-" + movie.TmdbId.ToString();
|
|
|
|
movie.TitleSlug += "-" + movie.TmdbId.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
movie.Images.Add(_configService.GetCoverForURL(resource.poster_path, MediaCoverTypes.Poster));//TODO: Update to load image specs from tmdb page!
|
|
|
|
movie.Images.Add(MapImage(resource.poster_path, MediaCoverTypes.Poster));//TODO: Update to load image specs from tmdb page!
|
|
|
|
movie.Images.Add(_configService.GetCoverForURL(resource.backdrop_path, MediaCoverTypes.Fanart));
|
|
|
|
movie.Images.Add(MapImage(resource.backdrop_path, MediaCoverTypes.Fanart));
|
|
|
|
|
|
|
|
|
|
|
|
movie.Runtime = resource.runtime;
|
|
|
|
movie.Runtime = resource.runtime;
|
|
|
|
|
|
|
|
|
|
|
|
//foreach(Title title in resource.alternative_titles.titles)
|
|
|
|
//foreach(Title title in resource.alternative_titles.titles)
|
|
|
@ -422,7 +423,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new List<Movie> { GetMovieInfo(parserResult.ImdbId) };
|
|
|
|
return new List<Movie> { GetMovieInfo(parserResult.ImdbId) };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new List<Movie>();
|
|
|
|
return new List<Movie>();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -540,13 +541,11 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Debug("Not a valid date time.");
|
|
|
|
_logger.Debug("Not a valid date time.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var now = DateTime.Now;
|
|
|
|
var now = DateTime.Now;
|
|
|
|
//handle the case when we have both theatrical and physical release dates
|
|
|
|
//handle the case when we have both theatrical and physical release dates
|
|
|
|
if (imdbMovie.InCinemas.HasValue && imdbMovie.PhysicalRelease.HasValue)
|
|
|
|
if (imdbMovie.InCinemas.HasValue && imdbMovie.PhysicalRelease.HasValue)
|
|
|
@ -588,10 +587,9 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var imdbPoster = _configService.GetCoverForURL(result.poster_path, MediaCoverTypes.Poster);
|
|
|
|
imdbMovie.Images.AddIfNotNull(MapImage(result.poster_path, MediaCoverTypes.Poster));
|
|
|
|
imdbMovie.Images.Add(imdbPoster);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Debug(result);
|
|
|
|
_logger.Debug(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -615,61 +613,14 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static Actor MapActors(ActorResource arg)
|
|
|
|
private MediaCover.MediaCover MapImage(string path, MediaCoverTypes type)
|
|
|
|
{
|
|
|
|
|
|
|
|
var newActor = new Actor
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Name = arg.Name,
|
|
|
|
|
|
|
|
Character = arg.Character
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (arg.Image != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
newActor.Images = new List<MediaCover.MediaCover>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
new MediaCover.MediaCover(MediaCoverTypes.Headshot, arg.Image)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return newActor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Ratings MapRatings(RatingResource rating)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (rating == null)
|
|
|
|
if (path.IsNotNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new Ratings();
|
|
|
|
return _configService.GetCoverForURL(path, type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return new Ratings
|
|
|
|
return null;
|
|
|
|
{
|
|
|
|
|
|
|
|
Votes = rating.Count,
|
|
|
|
|
|
|
|
Value = rating.Value
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static MediaCover.MediaCover MapImage(ImageResource arg)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new MediaCover.MediaCover
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Url = arg.Url,
|
|
|
|
|
|
|
|
CoverType = MapCoverType(arg.CoverType)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static MediaCoverTypes MapCoverType(string coverType)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
switch (coverType.ToLower())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case "poster":
|
|
|
|
|
|
|
|
return MediaCoverTypes.Poster;
|
|
|
|
|
|
|
|
case "banner":
|
|
|
|
|
|
|
|
return MediaCoverTypes.Banner;
|
|
|
|
|
|
|
|
case "fanart":
|
|
|
|
|
|
|
|
return MediaCoverTypes.Fanart;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return MediaCoverTypes.Unknown;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Movie MapMovieToTmdbMovie(Movie movie)
|
|
|
|
public Movie MapMovieToTmdbMovie(Movie movie)
|
|
|
|