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))
### 🐛 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))
* 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))

View File

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

View File

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

View File

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

View File

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

View File

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