Skip to content

Commit

Permalink
Make Unrecognized also check for series and episode existence
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Jan 3, 2024
1 parent 8078e70 commit 6130315
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Shoko.Server/API/v3/Helpers/ModelHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ public static ListResult<File> FilterFiles(IEnumerable<SVR_VideoLocal> input, SV
if (include_only.Contains(FileIncludeOnlyType.Duplicates) && locations.Count <= 1) return false;

if (exclude.Contains(FileExcludeTypes.Unrecognized) && xrefs.Count == 0) return false;
if (include_only.Contains(FileIncludeOnlyType.Unrecognized) && xrefs.Count > 0) return false;
if (include_only.Contains(FileIncludeOnlyType.Unrecognized) && xrefs.Count > 0 && xrefs.Any(x =>
RepoFactory.AnimeSeries.GetByAnimeID(x.AnimeID) != null &&
RepoFactory.AnimeEpisode.GetByAniDBEpisodeID(x.EpisodeID) != null)) return false;

if (exclude.Contains(FileExcludeTypes.ManualLinks) && xrefs.Count > 0 &&
xrefs.Any(xref => xref.CrossRefSource != (int)CrossRefSource.AniDB)) return false;
Expand Down

0 comments on commit 6130315

Please sign in to comment.