1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

Fixed: Don't fail on duplicate Alt Titles (Temp)

This commit is contained in:
Qstick 2020-05-26 21:57:16 -04:00
parent f0be9994b1
commit 6ecffc9bed

View File

@ -82,6 +82,9 @@ public List<AlternativeTitle> UpdateTitles(List<AlternativeTitle> titles, Movie
// Then make sure they are all distinct titles
titles = titles.DistinctBy(t => t.CleanTitle).ToList();
// Make sure we are not adding titles that exist for other movies (until language PR goes in)
titles = titles.Where(t => !_titleRepo.All().Any(e => e.CleanTitle == t.CleanTitle && e.MovieId != t.MovieId)).ToList();
// Now find titles to delete, update and insert.
var existingTitles = _titleRepo.FindByMovieId(movieId);