From 7199d2b5aca033b34fef44bdda4cc335d15be0b0 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:19:36 +1100 Subject: [PATCH] Handle legacy scene movies criterion in saved filters (#5348) --- ui/v2.5/src/models/list-filter/criteria/groups.ts | 10 ++++++++++ ui/v2.5/src/models/list-filter/scenes.ts | 6 +++++- ui/v2.5/src/models/list-filter/types.ts | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ui/v2.5/src/models/list-filter/criteria/groups.ts b/ui/v2.5/src/models/list-filter/criteria/groups.ts index f7fd42492de..762ebf6e8b7 100644 --- a/ui/v2.5/src/models/list-filter/criteria/groups.ts +++ b/ui/v2.5/src/models/list-filter/criteria/groups.ts @@ -42,3 +42,13 @@ export const SubGroupsCriterionOption = new BaseGroupsCriterionOption( "sub_groups", "sub_groups" ); + +// redirects to GroupsCriterion +export const LegacyMoviesCriterionOption = new CriterionOption({ + messageID: "groups", + type: "movies", + modifierOptions, + defaultModifier, + inputType, + makeCriterion: () => new GroupsCriterion(GroupsCriterionOption), +}); diff --git a/ui/v2.5/src/models/list-filter/scenes.ts b/ui/v2.5/src/models/list-filter/scenes.ts index 965fa31be10..7496da6b62d 100644 --- a/ui/v2.5/src/models/list-filter/scenes.ts +++ b/ui/v2.5/src/models/list-filter/scenes.ts @@ -8,7 +8,10 @@ import { } from "./criteria/criterion"; import { HasMarkersCriterionOption } from "./criteria/has-markers"; import { SceneIsMissingCriterionOption } from "./criteria/is-missing"; -import { GroupsCriterionOption } from "./criteria/groups"; +import { + GroupsCriterionOption, + LegacyMoviesCriterionOption, +} from "./criteria/groups"; import { GalleriesCriterionOption } from "./criteria/galleries"; import { OrganizedCriterionOption } from "./criteria/organized"; import { PerformersCriterionOption } from "./criteria/performers"; @@ -106,6 +109,7 @@ const criterionOptions = [ // StudioTagsCriterionOption, StudiosCriterionOption, GroupsCriterionOption, + LegacyMoviesCriterionOption, GalleriesCriterionOption, createStringCriterionOption("url"), StashIDCriterionOption, diff --git a/ui/v2.5/src/models/list-filter/types.ts b/ui/v2.5/src/models/list-filter/types.ts index b632609ab8b..48e37c0461d 100644 --- a/ui/v2.5/src/models/list-filter/types.ts +++ b/ui/v2.5/src/models/list-filter/types.ts @@ -148,6 +148,7 @@ export type CriterionType = | "studios" | "scenes" | "groups" + | "movies" // legacy | "containing_groups" | "containing_group_count" | "sub_groups"