|
|
@ -108,7 +108,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
[HttpGet]
|
|
|
|
public List<MovieResource> AllMovie(int? tmdbId)
|
|
|
|
public List<MovieResource> AllMovie(int? tmdbId, bool excludeLocalCovers = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var moviesResources = new List<MovieResource>();
|
|
|
|
var moviesResources = new List<MovieResource>();
|
|
|
|
|
|
|
|
|
|
|
@ -135,7 +135,10 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
|
|
|
|
|
|
|
|
var tdict = translations.ToDictionary(x => x.MovieMetadataId);
|
|
|
|
var tdict = translations.ToDictionary(x => x.MovieMetadataId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!excludeLocalCovers)
|
|
|
|
|
|
|
|
{
|
|
|
|
coverFileInfos = _coverMapper.GetCoverFileInfos();
|
|
|
|
coverFileInfos = _coverMapper.GetCoverFileInfos();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var movies = movieTask.GetAwaiter().GetResult();
|
|
|
|
var movies = movieTask.GetAwaiter().GetResult();
|
|
|
|
|
|
|
|
|
|
|
@ -147,7 +150,10 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
moviesResources.Add(movie.ToResource(availDelay, translation, _qualityUpgradableSpecification));
|
|
|
|
moviesResources.Add(movie.ToResource(availDelay, translation, _qualityUpgradableSpecification));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!excludeLocalCovers)
|
|
|
|
|
|
|
|
{
|
|
|
|
MapCoversToLocal(moviesResources, coverFileInfos);
|
|
|
|
MapCoversToLocal(moviesResources, coverFileInfos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var rootFolders = _rootFolderService.All();
|
|
|
|
var rootFolders = _rootFolderService.All();
|
|
|
|
|
|
|
|
|
|
|
@ -271,10 +277,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
|
public void Handle(MovieFileImportedEvent message)
|
|
|
|
public void Handle(MovieFileImportedEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var availDelay = _configService.AvailabilityDelay;
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, MapToResource(message.ImportedMovie.Movie));
|
|
|
|
var translations = _movieTranslationService.GetAllTranslationsForMovieMetadata(message.ImportedMovie.Movie.MovieMetadataId);
|
|
|
|
|
|
|
|
var translation = GetMovieTranslation(translations, message.ImportedMovie.Movie.MovieMetadata, (Language)_configService.MovieInfoLanguage);
|
|
|
|
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, message.ImportedMovie.Movie.ToResource(availDelay, translation, _qualityUpgradableSpecification));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
@ -291,19 +294,13 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
|
public void Handle(MovieUpdatedEvent message)
|
|
|
|
public void Handle(MovieUpdatedEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var availDelay = _configService.AvailabilityDelay;
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, MapToResource(message.Movie));
|
|
|
|
var translations = _movieTranslationService.GetAllTranslationsForMovieMetadata(message.Movie.MovieMetadataId);
|
|
|
|
|
|
|
|
var translation = GetMovieTranslation(translations, message.Movie.MovieMetadata, (Language)_configService.MovieInfoLanguage);
|
|
|
|
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, message.Movie.ToResource(availDelay, translation, _qualityUpgradableSpecification));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
|
public void Handle(MovieEditedEvent message)
|
|
|
|
public void Handle(MovieEditedEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var availDelay = _configService.AvailabilityDelay;
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, MapToResource(message.Movie));
|
|
|
|
var translations = _movieTranslationService.GetAllTranslationsForMovieMetadata(message.Movie.MovieMetadataId);
|
|
|
|
|
|
|
|
var translation = GetMovieTranslation(translations, message.Movie.MovieMetadata, (Language)_configService.MovieInfoLanguage);
|
|
|
|
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, message.Movie.ToResource(availDelay, translation, _qualityUpgradableSpecification));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
@ -318,10 +315,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
|
public void Handle(MovieRenamedEvent message)
|
|
|
|
public void Handle(MovieRenamedEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var availDelay = _configService.AvailabilityDelay;
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, MapToResource(message.Movie));
|
|
|
|
var translations = _movieTranslationService.GetAllTranslationsForMovieMetadata(message.Movie.MovieMetadataId);
|
|
|
|
|
|
|
|
var translation = GetMovieTranslation(translations, message.Movie.MovieMetadata, (Language)_configService.MovieInfoLanguage);
|
|
|
|
|
|
|
|
BroadcastResourceChange(ModelAction.Updated, message.Movie.ToResource(availDelay, translation, _qualityUpgradableSpecification));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
|