mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Prevent studio from being selected as its own parent (#1051)
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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 } });
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ export const Studio: React.FC = () => {
|
|||||||
}
|
}
|
||||||
ids={parentStudioId ? [parentStudioId] : []}
|
ids={parentStudioId ? [parentStudioId] : []}
|
||||||
isDisabled={!isEditing}
|
isDisabled={!isEditing}
|
||||||
|
excludeIds={studio.id ? [studio.id] : []}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user