From a96d01c3f10a66517ab0d7041f6825d8ab1637f3 Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Sat, 7 Dec 2024 21:54:43 +0100 Subject: [PATCH] fix: remove xrefs for missing tmdb episodes --- Shoko.Server/Providers/TMDB/TmdbLinkingService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shoko.Server/Providers/TMDB/TmdbLinkingService.cs b/Shoko.Server/Providers/TMDB/TmdbLinkingService.cs index 86fff5330..f6bdb23de 100644 --- a/Shoko.Server/Providers/TMDB/TmdbLinkingService.cs +++ b/Shoko.Server/Providers/TMDB/TmdbLinkingService.cs @@ -714,7 +714,7 @@ public IReadOnlyList MatchAnidbToTmdbEpisodes(int a // Remove the current anidb episodes that does not overlap with the show. var toRemove = existing.Values .SelectMany(list => list) - .Where(xref => anidbEpisodes.ContainsKey(xref.AnidbEpisodeID) && !toSkip.Contains(xref.CrossRef_AniDB_TMDB_EpisodeID)) + .Where(xref => (anidbEpisodes.ContainsKey(xref.AnidbEpisodeID) && !toSkip.Contains(xref.CrossRef_AniDB_TMDB_EpisodeID)) || (xref.TmdbShowID == tmdbShowId && !tmdbEpisodeDict.ContainsKey(xref.TmdbEpisodeID))) .ToList(); _logger.LogDebug(