Use a default stash-box name if none provided (#1889)

* Use a default stash-box name if none provided
This commit is contained in:
WithoutPants
2021-10-27 11:54:55 +11:00
committed by GitHub
parent bdb8dc94d3
commit 2136ced25c
6 changed files with 15 additions and 5 deletions

View File

@@ -16,6 +16,7 @@
* Optimised scanning process. ([#1816](https://github.com/stashapp/stash/pull/1816)) * Optimised scanning process. ([#1816](https://github.com/stashapp/stash/pull/1816))
### 🐛 Bug fixes ### 🐛 Bug fixes
* Fix tiny menu items in scrape menu when a stash-box instance has no name. ([#1889](https://github.com/stashapp/stash/pull/1889))
* Fix creating missing entities removing the incorrect entry from the missing list in the scrape dialog. ([#1890](https://github.com/stashapp/stash/pull/1890)) * Fix creating missing entities removing the incorrect entry from the missing list in the scrape dialog. ([#1890](https://github.com/stashapp/stash/pull/1890))
* Allow creating missing Studio during movie scrape. ([#1899](https://github.com/stashapp/stash/pull/1899)) * Allow creating missing Studio during movie scrape. ([#1899](https://github.com/stashapp/stash/pull/1899))
* Fix image files in folder galleries not being deleting when delete file option is checked. ([#1872](https://github.com/stashapp/stash/pull/1872)) * Fix image files in folder galleries not being deleting when delete file option is checked. ([#1872](https://github.com/stashapp/stash/pull/1872))

View File

@@ -40,6 +40,7 @@ import {
stringToGender, stringToGender,
} from "src/utils/gender"; } from "src/utils/gender";
import { ConfigurationContext } from "src/hooks/Config"; import { ConfigurationContext } from "src/hooks/Config";
import { stashboxDisplayName } from "src/utils/stashbox";
import { PerformerScrapeDialog } from "./PerformerScrapeDialog"; import { PerformerScrapeDialog } from "./PerformerScrapeDialog";
import PerformerScrapeModal from "./PerformerScrapeModal"; import PerformerScrapeModal from "./PerformerScrapeModal";
import PerformerStashBoxModal, { IStashBox } from "./PerformerStashBoxModal"; import PerformerStashBoxModal, { IStashBox } from "./PerformerStashBoxModal";
@@ -580,7 +581,7 @@ export const PerformerEditPanel: React.FC<IPerformerDetails> = ({
className="minimal" className="minimal"
onClick={() => onScraperSelected({ ...s, index })} onClick={() => onScraperSelected({ ...s, index })}
> >
{s.name ?? "Stash-Box"} {stashboxDisplayName(s.name, index)}
</Dropdown.Item> </Dropdown.Item>
))} ))}
{queryableScrapers {queryableScrapers

View File

@@ -5,6 +5,7 @@ import { useIntl } from "react-intl";
import * as GQL from "src/core/generated-graphql"; import * as GQL from "src/core/generated-graphql";
import { Modal, LoadingIndicator } from "src/components/Shared"; import { Modal, LoadingIndicator } from "src/components/Shared";
import { stashboxDisplayName } from "src/utils/stashbox";
const CLASSNAME = "PerformerScrapeModal"; const CLASSNAME = "PerformerScrapeModal";
const CLASSNAME_LIST = `${CLASSNAME}-list`; const CLASSNAME_LIST = `${CLASSNAME}-list`;
@@ -52,7 +53,10 @@ const PerformerStashBoxModal: React.FC<IProps> = ({
<Modal <Modal
show show
onHide={onHide} onHide={onHide}
header={`Scrape performer from ${instance.name ?? "Stash-Box"}`} header={`Scrape performer from ${stashboxDisplayName(
instance.name,
instance.index
)}`}
accept={{ accept={{
text: intl.formatMessage({ id: "actions.cancel" }), text: intl.formatMessage({ id: "actions.cancel" }),
onClick: onHide, onClick: onHide,

View File

@@ -35,6 +35,7 @@ import { MovieSelect } from "src/components/Shared/Select";
import { useFormik } from "formik"; import { useFormik } from "formik";
import { Prompt } from "react-router"; import { Prompt } from "react-router";
import { ConfigurationContext } from "src/hooks/Config"; import { ConfigurationContext } from "src/hooks/Config";
import { stashboxDisplayName } from "src/utils/stashbox";
import { SceneMovieTable } from "./SceneMovieTable"; import { SceneMovieTable } from "./SceneMovieTable";
import { RatingStars } from "./RatingStars"; import { RatingStars } from "./RatingStars";
import { SceneScrapeDialog } from "./SceneScrapeDialog"; import { SceneScrapeDialog } from "./SceneScrapeDialog";
@@ -396,7 +397,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
key={s.endpoint} key={s.endpoint}
onClick={() => onScrapeQueryClicked({ stash_box_index: index })} onClick={() => onScrapeQueryClicked({ stash_box_index: index })}
> >
{s.name ?? "Stash-Box"} {stashboxDisplayName(s.name, index)}
</Dropdown.Item> </Dropdown.Item>
))} ))}
{queryableScrapers.map((s) => ( {queryableScrapers.map((s) => (
@@ -463,7 +464,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
key={s.endpoint} key={s.endpoint}
onClick={() => onScrapeClicked({ stash_box_index: index })} onClick={() => onScrapeClicked({ stash_box_index: index })}
> >
{s.name ?? "Stash-Box"} {stashboxDisplayName(s.name, index)}
</Dropdown.Item> </Dropdown.Item>
))} ))}
{fragmentScrapers.map((s) => ( {fragmentScrapers.map((s) => (

View File

@@ -141,7 +141,7 @@ export const TaggerContext: React.FC = ({ children }) => {
sourceInput: { sourceInput: {
stash_box_index: i, stash_box_index: i,
}, },
displayName: `stash-box: ${s.name}`, displayName: `stash-box: ${s.name || `#${i + 1}`}`,
supportSceneFragment: true, supportSceneFragment: true,
supportSceneQuery: true, supportSceneQuery: true,
})); }));

View File

@@ -0,0 +1,3 @@
export function stashboxDisplayName(name: string, index: number) {
return name || `Stash-Box #${index + 1}`;
}