mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-23 22:25:14 -04:00
New: Movie Certifications
This commit is contained in:
@@ -8,6 +8,7 @@ using NLog;
|
||||
using NzbDrone.Common.Cloud;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Exceptions;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
@@ -29,30 +30,30 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
private readonly Logger _logger;
|
||||
|
||||
private readonly IHttpRequestBuilderFactory _movieBuilder;
|
||||
private readonly ITmdbConfigService _configService;
|
||||
private readonly ITmdbConfigService _tmdbConfigService;
|
||||
private readonly IConfigService _configService;
|
||||
private readonly IMovieService _movieService;
|
||||
private readonly IPreDBService _predbService;
|
||||
private readonly IImportExclusionsService _exclusionService;
|
||||
private readonly IAlternativeTitleService _altTitleService;
|
||||
private readonly IRadarrAPIClient _radarrAPI;
|
||||
|
||||
public SkyHookProxy(IHttpClient httpClient,
|
||||
IRadarrCloudRequestBuilder requestBuilder,
|
||||
ITmdbConfigService configService,
|
||||
ITmdbConfigService tmdbConfigService,
|
||||
IConfigService configService,
|
||||
IMovieService movieService,
|
||||
IPreDBService predbService,
|
||||
IImportExclusionsService exclusionService,
|
||||
IAlternativeTitleService altTitleService,
|
||||
IRadarrAPIClient radarrAPI,
|
||||
Logger logger)
|
||||
{
|
||||
_httpClient = httpClient;
|
||||
_movieBuilder = requestBuilder.TMDB;
|
||||
_tmdbConfigService = tmdbConfigService;
|
||||
_configService = configService;
|
||||
_movieService = movieService;
|
||||
_predbService = predbService;
|
||||
_exclusionService = exclusionService;
|
||||
_altTitleService = altTitleService;
|
||||
_radarrAPI = radarrAPI;
|
||||
|
||||
_logger = logger;
|
||||
@@ -185,13 +186,9 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
movie.Images.AddIfNotNull(MapImage(resource.backdrop_path, MediaCoverTypes.Fanart));
|
||||
movie.Runtime = resource.runtime;
|
||||
|
||||
//foreach(Title title in resource.alternative_titles.titles)
|
||||
//{
|
||||
// movie.AlternativeTitles.Add(title.title);
|
||||
//}
|
||||
foreach (ReleaseDates releaseDates in resource.release_dates.results)
|
||||
foreach (var releaseDates in resource.release_dates.results)
|
||||
{
|
||||
foreach (ReleaseDate releaseDate in releaseDates.release_dates)
|
||||
foreach (var releaseDate in releaseDates.release_dates)
|
||||
{
|
||||
if (releaseDate.type == 5 || releaseDate.type == 4)
|
||||
{
|
||||
@@ -209,6 +206,12 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
movie.PhysicalReleaseNote = releaseDate.note;
|
||||
}
|
||||
}
|
||||
|
||||
// Set Certification from Theatrical Release
|
||||
if (releaseDate.type == 3 && releaseDates.iso_3166_1 == _configService.CertificationCountry.ToString())
|
||||
{
|
||||
movie.Certification = releaseDate.certification;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +219,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
movie.Ratings.Votes = resource.vote_count;
|
||||
movie.Ratings.Value = (decimal)resource.vote_average;
|
||||
|
||||
foreach (Genre genre in resource.genres)
|
||||
foreach (var genre in resource.genres)
|
||||
{
|
||||
movie.Genres.Add(genre.name);
|
||||
}
|
||||
@@ -708,7 +711,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
{
|
||||
if (path.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
return _configService.GetCoverForURL(path, type);
|
||||
return _tmdbConfigService.GetCoverForURL(path, type);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user