mirror of
https://github.com/Radarr/Radarr
synced 2025-12-25 17:52:43 +01:00
Fixed: Loading movies with duplicated translations
This commit is contained in:
parent
55b9477a01
commit
69a9c72286
4 changed files with 8 additions and 11 deletions
|
|
@ -54,10 +54,8 @@ public static Dictionary<TKey, TItem> ToDictionaryIgnoreDuplicates<TItem, TKey>(
|
|||
foreach (var item in src)
|
||||
{
|
||||
var key = keySelector(item);
|
||||
if (!result.ContainsKey(key))
|
||||
{
|
||||
result[key] = item;
|
||||
}
|
||||
|
||||
result.TryAdd(key, item);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
@ -69,10 +67,9 @@ public static Dictionary<TKey, TValue> ToDictionaryIgnoreDuplicates<TItem, TKey,
|
|||
foreach (var item in src)
|
||||
{
|
||||
var key = keySelector(item);
|
||||
if (!result.ContainsKey(key))
|
||||
{
|
||||
result[key] = valueSelector(item);
|
||||
}
|
||||
var value = valueSelector(item);
|
||||
|
||||
result.TryAdd(key, value);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ private IEnumerable<CollectionResource> MapToResource(List<MovieCollection> coll
|
|||
.ToDictionary(x => x.Key, x => (IEnumerable<MovieMetadata>)x);
|
||||
|
||||
var translations = _movieTranslationService.GetAllTranslationsForLanguage(configLanguage);
|
||||
var tdict = translations.ToDictionary(x => x.MovieMetadataId);
|
||||
var tdict = translations.ToDictionaryIgnoreDuplicates(x => x.MovieMetadataId);
|
||||
|
||||
foreach (var collection in collections)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ public List<MovieResource> AllMovie(int? tmdbId, bool excludeLocalCovers = false
|
|||
var translations = _movieTranslationService
|
||||
.GetAllTranslationsForLanguage(translationLanguage);
|
||||
|
||||
var tdict = translations.ToDictionary(x => x.MovieMetadataId);
|
||||
var tdict = translations.ToDictionaryIgnoreDuplicates(x => x.MovieMetadataId);
|
||||
var sdict = movieStats.ToDictionary(x => x.MovieId);
|
||||
|
||||
if (!excludeLocalCovers)
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ public IActionResult SaveAll([FromBody] MovieEditorResource resource)
|
|||
var availabilityDelay = _configService.AvailabilityDelay;
|
||||
|
||||
var translations = _movieTranslationService.GetAllTranslationsForLanguage(configLanguage);
|
||||
var tdict = translations.ToDictionary(x => x.MovieMetadataId);
|
||||
var tdict = translations.ToDictionaryIgnoreDuplicates(x => x.MovieMetadataId);
|
||||
|
||||
var updatedMovies = _movieService.UpdateMovie(moviesToUpdate, !resource.MoveFiles);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue