Fixed: Don't die in Collections when a collection doesn't have movies

pull/9288/head
Bogdan 1 year ago
parent ecfaea3885
commit 9b36404071

@ -159,19 +159,22 @@ namespace Radarr.Api.V3.Collections
allCollectionMovies.TryGetValue(collection.TmdbId, out var collectionMovies);
foreach (var movie in collectionMovies)
if (collectionMovies != null)
{
var translation = GetTranslationFromDict(tdict, movie, configLanguage);
foreach (var movie in collectionMovies)
{
var translation = GetTranslationFromDict(tdict, movie, configLanguage);
var movieResource = movie.ToResource(translation);
movieResource.Folder = _fileNameBuilder.GetMovieFolder(new Movie { MovieMetadata = movie }, namingConfig);
var movieResource = movie.ToResource(translation);
movieResource.Folder = _fileNameBuilder.GetMovieFolder(new Movie { MovieMetadata = movie }, namingConfig);
if (!existingMoviesTmdbIds.Contains(movie.TmdbId))
{
resource.MissingMovies++;
}
if (!existingMoviesTmdbIds.Contains(movie.TmdbId))
{
resource.MissingMovies++;
}
resource.Movies.Add(movieResource);
resource.Movies.Add(movieResource);
}
}
yield return resource;

Loading…
Cancel
Save