Prevent studio from being selected as its own parent (#1051)

This commit is contained in:
InfiniteTF
2021-01-12 07:11:01 +01:00
committed by GitHub
parent 3d83fa449d
commit 8a3d940aa7
3 changed files with 9 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
* Support configurable number of threads for scanning and generation. * Support configurable number of threads for scanning and generation.
### 🐛 Bug fixes ### 🐛 Bug fixes
* Prevent studio from being set as its own parent
* Fixed performer scraper select overlapping search results * Fixed performer scraper select overlapping search results
* Fix tag/studio images not being changed after update. * Fix tag/studio images not being changed after update.
* Fixed resolution tags and querying for portrait videos and images. * Fixed resolution tags and querying for portrait videos and images.

View File

@@ -379,11 +379,16 @@ export const PerformerSelect: React.FC<IFilterProps> = (props) => {
); );
}; };
export const StudioSelect: React.FC<IFilterProps> = (props) => { export const StudioSelect: React.FC<
IFilterProps & { excludeIds?: string[] }
> = (props) => {
const { data, loading } = useAllStudiosForFilter(); const { data, loading } = useAllStudiosForFilter();
const [createStudio] = useStudioCreate({ name: "" }); const [createStudio] = useStudioCreate({ name: "" });
const studios = data?.allStudiosSlim ?? []; const exclude = props.excludeIds ?? [];
const studios = (data?.allStudiosSlim ?? []).filter(
(studio) => !exclude.includes(studio.id)
);
const onCreate = async (name: string) => { const onCreate = async (name: string) => {
const result = await createStudio({ variables: { name } }); const result = await createStudio({ variables: { name } });

View File

@@ -259,6 +259,7 @@ export const Studio: React.FC = () => {
} }
ids={parentStudioId ? [parentStudioId] : []} ids={parentStudioId ? [parentStudioId] : []}
isDisabled={!isEditing} isDisabled={!isEditing}
excludeIds={studio.id ? [studio.id] : []}
/> />
); );
} }