Compare commits

...

4 Commits

Author SHA1 Message Date
Ivan Sanz Carasa 193b942ea4
Merge 1b7211214f into 3db78079f3 2024-04-26 17:33:08 +02:00
Bogdan 3db78079f3 Fixed: Retrying download on not suppressed HTTP errors 2024-04-25 17:22:49 +03:00
Ivan Sanz Carasa 1b7211214f use QSP `language` instead 2024-04-24 19:38:22 +02:00
Ivan Sanz Carasa c2e55e60fd New: add EnglishTitle to the /movie API endpoint 2024-04-24 19:17:17 +02:00
2 changed files with 7 additions and 4 deletions

View File

@ -34,6 +34,7 @@ namespace NzbDrone.Core.Download
{
{ Result.HasHttpServerError: true } => PredicateResult.True(),
{ Result.StatusCode: HttpStatusCode.RequestTimeout } => PredicateResult.True(),
{ Exception: HttpException { Response.HasHttpServerError: true } } => PredicateResult.True(),
_ => PredicateResult.False()
},
Delay = TimeSpan.FromSeconds(3),

View File

@ -112,7 +112,7 @@ namespace Radarr.Api.V3.Movies
}
[HttpGet]
public List<MovieResource> AllMovie(int? tmdbId, bool excludeLocalCovers = false)
public List<MovieResource> AllMovie(int? tmdbId, string language, bool excludeLocalCovers = false)
{
var moviesResources = new List<MovieResource>();
@ -130,13 +130,15 @@ namespace Radarr.Api.V3.Movies
else
{
var movieStats = _movieStatisticsService.MovieStatistics();
var configLanguage = (Language)_configService.MovieInfoLanguage;
var translationLanguage = language != null
? Language.All.Single(l => l.Name.Equals(language, StringComparison.InvariantCultureIgnoreCase))
: (Language)_configService.MovieInfoLanguage;
var availDelay = _configService.AvailabilityDelay;
var movieTask = Task.Run(() => _moviesService.GetAllMovies());
var translations = _movieTranslationService
.GetAllTranslationsForLanguage(configLanguage);
.GetAllTranslationsForLanguage(translationLanguage);
var tdict = translations.ToDictionary(x => x.MovieMetadataId);
var sdict = movieStats.ToDictionary(x => x.MovieId);
@ -152,7 +154,7 @@ namespace Radarr.Api.V3.Movies
foreach (var movie in movies)
{
var translation = GetTranslationFromDict(tdict, movie.MovieMetadata, configLanguage);
var translation = GetTranslationFromDict(tdict, movie.MovieMetadata, translationLanguage);
moviesResources.Add(movie.ToResource(availDelay, translation, _qualityUpgradableSpecification));
}