mirror of
https://github.com/stashapp/stash.git
synced 2026-02-27 09:42:57 +01:00
Prevent studio from being selected as its own parent (#1051)
This commit is contained in:
parent
3d83fa449d
commit
8a3d940aa7
3 changed files with 9 additions and 2 deletions
|
|
@ -21,6 +21,7 @@
|
|||
* Support configurable number of threads for scanning and generation.
|
||||
|
||||
### 🐛 Bug fixes
|
||||
* Prevent studio from being set as its own parent
|
||||
* Fixed performer scraper select overlapping search results
|
||||
* Fix tag/studio images not being changed after update.
|
||||
* 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 [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 result = await createStudio({ variables: { name } });
|
||||
|
|
|
|||
|
|
@ -259,6 +259,7 @@ export const Studio: React.FC = () => {
|
|||
}
|
||||
ids={parentStudioId ? [parentStudioId] : []}
|
||||
isDisabled={!isEditing}
|
||||
excludeIds={studio.id ? [studio.id] : []}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue