diff --git a/Shoko.Server/API/v3/Controllers/FileController.cs b/Shoko.Server/API/v3/Controllers/FileController.cs index 08bfca5d6..e117f6337 100644 --- a/Shoko.Server/API/v3/Controllers/FileController.cs +++ b/Shoko.Server/API/v3/Controllers/FileController.cs @@ -1471,6 +1471,7 @@ public ActionResult> RegexSearchByFileName([FromRoute] string path) /// Page number. /// Set to false to exclude series and episode cross-references. /// + [Obsolete("Use the universal file endpoint instead.")] [HttpGet("MissingCrossReferenceData")] public ActionResult> GetFilesWithMissingCrossReferenceData( [FromQuery, Range(0, 1000)] int pageSize = 100, diff --git a/Shoko.Server/API/v3/Helpers/ModelHelper.cs b/Shoko.Server/API/v3/Helpers/ModelHelper.cs index b1e877575..b941e8a00 100644 --- a/Shoko.Server/API/v3/Helpers/ModelHelper.cs +++ b/Shoko.Server/API/v3/Helpers/ModelHelper.cs @@ -549,9 +549,11 @@ public static ListResult FilterFiles(IEnumerable 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 && xrefs.Any(x => - RepoFactory.AnimeSeries.GetByAnimeID(x.AnimeID) != null && - RepoFactory.AnimeEpisode.GetByAniDBEpisodeID(x.EpisodeID) != null)) return false; + if (include_only.Contains(FileIncludeOnlyType.Unrecognized) && xrefs.Count > 0) return false; + + // this one is also special because files in import limbo are excluded by default + if (!include_only.Contains(FileIncludeOnlyType.ImportLimbo) && !include.Contains(FileNonDefaultIncludeType.ImportLimbo) && xrefs.Count > 0 && xrefs.Any(x => x.AniDBAnime is not null && x.AniDBEpisode is not null)) return false; + if (include_only.Contains(FileIncludeOnlyType.ImportLimbo) && !(xrefs.Count > 0 && xrefs.Any(x => x.AniDBAnime is not null && x.AniDBEpisode is not null))) return false; if (exclude.Contains(FileExcludeTypes.ManualLinks) && xrefs.Count > 0 && xrefs.All(xref => xref.CrossRefSource == (int)CrossRefSource.User)) return false; diff --git a/Shoko.Server/API/v3/Models/Common/FileIncludeTypes.cs b/Shoko.Server/API/v3/Models/Common/FileIncludeTypes.cs index bf263b420..d56218e73 100644 --- a/Shoko.Server/API/v3/Models/Common/FileIncludeTypes.cs +++ b/Shoko.Server/API/v3/Models/Common/FileIncludeTypes.cs @@ -19,7 +19,8 @@ public enum FileNonDefaultIncludeType Ignored, MediaInfo, XRefs, - AbsolutePaths + AbsolutePaths, + ImportLimbo, } [JsonConverter(typeof(StringEnumConverter))] @@ -30,5 +31,6 @@ public enum FileIncludeOnlyType Duplicates, Unrecognized, ManualLinks, - Ignored + Ignored, + ImportLimbo, }