Expand tagger manual entry and add link to tagger interface (#947)

This commit is contained in:
InfiniteTF 2020-11-20 02:07:36 +01:00 committed by GitHub
parent e62e74bff4
commit 21806decca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 84 additions and 43 deletions

View file

@ -19,9 +19,14 @@ import { MarkdownPage } from "../Shared/MarkdownPage";
interface IManualProps {
show: boolean;
onClose: () => void;
defaultActiveTab?: string;
}
export const Manual: React.FC<IManualProps> = ({ show, onClose }) => {
export const Manual: React.FC<IManualProps> = ({
show,
onClose,
defaultActiveTab,
}) => {
const content = [
{
key: "Introduction.md",
@ -98,7 +103,9 @@ export const Manual: React.FC<IManualProps> = ({ show, onClose }) => {
},
];
const [activeTab, setActiveTab] = useState(content[0].key);
const [activeTab, setActiveTab] = useState(
defaultActiveTab ?? content[0].key
);
// links to other manual pages are specified as "/help/page.md"
// intercept clicks to these pages and set the tab accordingly

View file

@ -10,6 +10,7 @@ import {
stashBoxBatchQuery,
useConfiguration,
} from "src/core/StashService";
import { Manual } from "src/components/Help/Manual";
import StashSearchResult from "./StashSearchResult";
import Config, { ITaggerConfig, initialConfig, ParseMode } from "./Config";
@ -425,6 +426,7 @@ export const Tagger: React.FC<ITaggerProps> = ({ scenes }) => {
const stashConfig = useConfiguration();
const [config, setConfig] = useState<ITaggerConfig>(initialConfig);
const [showConfig, setShowConfig] = useState(false);
const [showManual, setShowManual] = useState(false);
const savedEndpointIndex =
stashConfig.data?.configuration.general.stashBoxes.findIndex(
@ -459,45 +461,61 @@ export const Tagger: React.FC<ITaggerProps> = ({ scenes }) => {
};
return (
<div className="tagger-container mx-auto">
{selectedEndpointIndex !== -1 && selectedEndpoint ? (
<>
<div className="row mb-2 no-gutters">
<Button onClick={() => setShowConfig(!showConfig)} variant="link">
{showConfig ? "Hide" : "Show"} Configuration
</Button>
</div>
<>
<Manual
show={showManual}
onClose={() => setShowManual(false)}
defaultActiveTab="Tagger.md"
/>
<div className="tagger-container mx-auto">
{selectedEndpointIndex !== -1 && selectedEndpoint ? (
<>
<div className="row mb-2 no-gutters">
<Button onClick={() => setShowConfig(!showConfig)} variant="link">
{showConfig ? "Hide" : "Show"} Configuration
</Button>
<Button
className="ml-auto"
onClick={() => setShowManual(true)}
title="Help"
variant="link"
>
Help
</Button>
</div>
<Config config={config} setConfig={setConfig} show={showConfig} />
<TaggerList
scenes={scenes}
config={config}
selectedEndpoint={{
endpoint: selectedEndpoint.endpoint,
index: selectedEndpointIndex,
}}
queueFingerprintSubmission={queueFingerprintSubmission}
clearSubmissionQueue={clearSubmissionQueue}
/>
</>
) : (
<div className="my-4">
<h3 className="text-center mt-4">
To use the scene tagger a stash-box instance needs to be configured.
</h3>
<h5 className="text-center">
Please see{" "}
<HashLink
to="/settings?tab=configuration#stashbox"
scroll={(el) =>
el.scrollIntoView({ behavior: "smooth", block: "center" })
}
>
Settings.
</HashLink>
</h5>
</div>
)}
</div>
<Config config={config} setConfig={setConfig} show={showConfig} />
<TaggerList
scenes={scenes}
config={config}
selectedEndpoint={{
endpoint: selectedEndpoint.endpoint,
index: selectedEndpointIndex,
}}
queueFingerprintSubmission={queueFingerprintSubmission}
clearSubmissionQueue={clearSubmissionQueue}
/>
</>
) : (
<div className="my-4">
<h3 className="text-center mt-4">
To use the scene tagger a stash-box instance needs to be
configured.
</h3>
<h5 className="text-center">
Please see{" "}
<HashLink
to="/settings?tab=configuration#stashbox"
scroll={(el) =>
el.scrollIntoView({ behavior: "smooth", block: "center" })
}
>
Settings.
</HashLink>
</h5>
</div>
)}
</div>
</>
);
};

View file

@ -1,5 +1,21 @@
# Scene Tagger
The search works by matching the query against a scene&rsquo;s title_, release date_, _studio name_, and _performer names_. An important thing to note is that it only returns a match *if all query terms are a match*.
Stash can be integrated with stash-box which acts as a centralized metadata database. This is in the early stages of development but can be used for fingerprint/keyword lookups and automated tagging of performers and scenes. The batch tagging interface can be accessed from the [scene view](/scenes?disp=3). For more information join our [Discord](https://discord.gg/2TsNFKt).
As an example, if a scene is titled `"A Trip to the Mall"`, a search for `"Trip to the Mall 1080p"` will *not* match, however `"trip mall"` would. Usually a few pieces of info is enough, for instance performer name + release date or studio name.
#### Searching
The fingerprint search matches your current selection of files against the remote stash-box instance. Any scenes with a matching fingerprint will be returned, although there is currently no validation of fingerprints so it&rsquo;s recommended to double-check the validity before saving.
If no fingerprint match is found it&rsquo;s possible to search by keywords. The search works by matching the query against a scene&rsquo;s title_, release date_, _studio name_, and _performer names_. By default the tagger uses metadata set on the file, or parses the filename, this can be changed in the config.
An important thing to note is that it only returns a match *if all query terms are a match*. As an example, if a scene is titled `"A Trip to the Mall"` with the performer `"Jane Doe"`, a search for `"Trip to the Mall 1080p"` will *not* match, however `"trip mall doe"` would. Usually a few pieces of info is enough, for instance performer name + release date or studio name. To avoid common non-related keywords you can add them to the blacklist in the tagger config. Any items in the blacklist are stripped out of the query.
#### Saving
When a scene is matched stash will try to match the studio and performers against your local studios and performers. If you have previously matched them, they will automatically be selected. If not you either have to select the correct performer/studio from the dropdown, choose create to create a new entity, or skip to ignore it.
Once a scene is saved the scene and the matched studio/performers will have the stash_id saved which will then be used for future tagging.
By default male performers are not shown, this can be enabled in the tagger config. Likewise scene tags are by default not saved. They can be set to either merge with existing tags on the scene, or overwrite them. It is not recommended to set tags currently since they are hard to deduplicate and can litter your data.
#### Submitting fingerprints
After a scene is saved you will prompted to submit the fingerprint back to the stash-box instance. This is optional, but can be helpful for other users who have an identical copy who will then be able to match via the fingerprint search. No other information than the stash_id and file fingerprint is submitted.