mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
WIP
This commit is contained in:
parent
505d7442cf
commit
438636a836
4 changed files with 12 additions and 33 deletions
|
|
@ -566,7 +566,7 @@ type Mutation {
|
|||
"Submit fingerprints to stash-box instance"
|
||||
submitStashBoxFingerprints(
|
||||
input: StashBoxFingerprintSubmissionInput!
|
||||
): Boolean!
|
||||
): Boolean! @deprecated(reason: "Use submitFingerprintSubmissions")
|
||||
|
||||
"Submit scene as draft to stash-box instance"
|
||||
submitStashBoxSceneDraft(input: StashBoxDraftSubmissionInput!): ID
|
||||
|
|
|
|||
|
|
@ -30,17 +30,10 @@ enum FingerprintVote {
|
|||
INVALID
|
||||
}
|
||||
|
||||
input FingerprintSubmissionInput {
|
||||
scene_id: ID!
|
||||
stash_box_scene_id: String!
|
||||
stash_box_endpoint: String!
|
||||
vote: FingerprintVote!
|
||||
}
|
||||
|
||||
input StashBoxFingerprintSubmissionInput {
|
||||
scene_ids: [String!] @deprecated(reason: "use fingerprints")
|
||||
fingerprints: [FingerprintSubmissionInput!]
|
||||
stash_box_endpoint: String @deprecated(reason: "use fingerprints")
|
||||
scene_ids: [String!]!
|
||||
stash_box_index: Int @deprecated(reason: "use stash_box_endpoint")
|
||||
stash_box_endpoint: String
|
||||
}
|
||||
|
||||
input StashBoxDraftSubmissionInput {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import (
|
|||
)
|
||||
|
||||
func (r *mutationResolver) SubmitStashBoxFingerprints(ctx context.Context, input StashBoxFingerprintSubmissionInput) (bool, error) {
|
||||
b, err := resolveStashBox(nil, input.StashBoxEndpoint)
|
||||
b, err := resolveStashBox(input.StashBoxIndex, input.StashBoxEndpoint) //nolint:staticcheck
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ const StashSearchResult: React.FC<IStashSearchResultProps> = ({
|
|||
await saveScene(sceneCreateInput, includeStashID, scene.remote_site_id ?? undefined);
|
||||
}
|
||||
|
||||
async function handleMarkWrong() {
|
||||
async function handleReportWrong() {
|
||||
if (!scene.remote_site_id) return;
|
||||
await queueFingerprintSubmission(stashScene.id, scene.remote_site_id, GQL.FingerprintVote.Invalid);
|
||||
onReportWrong?.();
|
||||
|
|
@ -549,11 +549,11 @@ const StashSearchResult: React.FC<IStashSearchResultProps> = ({
|
|||
await removeFingerprintSubmission(scene.remote_site_id);
|
||||
}
|
||||
|
||||
const isReportedWrong = scene.remote_site_id
|
||||
const alreadyReported = hasUserReportedFingerprint(scene, stashScene);
|
||||
const pendingReport = scene.remote_site_id
|
||||
? isReported(stashScene.id, scene.remote_site_id)
|
||||
: false;
|
||||
|
||||
const alreadyReported = hasUserReportedFingerprint(scene, stashScene);
|
||||
const isReportedWrong = alreadyReported || pendingReport;
|
||||
|
||||
function showPerformerModal(t: GQL.ScrapedPerformer) {
|
||||
createPerformerModal(t, (toCreate) => {
|
||||
|
|
@ -985,8 +985,8 @@ const StashSearchResult: React.FC<IStashSearchResultProps> = ({
|
|||
{scene.remote_site_id && !isReportedWrong && (
|
||||
<OperationButton
|
||||
className="mr-2"
|
||||
operation={handleMarkWrong}
|
||||
variant="outline-danger"
|
||||
operation={handleReportWrong}
|
||||
variant="danger"
|
||||
disabled={alreadyReported}
|
||||
>
|
||||
<Icon icon={faXmark} />
|
||||
|
|
@ -999,7 +999,7 @@ const StashSearchResult: React.FC<IStashSearchResultProps> = ({
|
|||
</span>
|
||||
</OperationButton>
|
||||
)}
|
||||
{scene.remote_site_id && isReportedWrong && (
|
||||
{scene.remote_site_id && pendingReport && (
|
||||
<OperationButton
|
||||
className="mr-2"
|
||||
operation={handleRemoveReport}
|
||||
|
|
@ -1017,20 +1017,6 @@ const StashSearchResult: React.FC<IStashSearchResultProps> = ({
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
{!isActive && scene.remote_site_id && isReportedWrong && (
|
||||
<div className="col-lg-6">
|
||||
<div className="ml-auto d-flex align-items-center">
|
||||
<OperationButton
|
||||
operation={handleRemoveReport}
|
||||
variant="danger"
|
||||
size="sm"
|
||||
title={intl.formatMessage({ id: "component_tagger.undo_report" })}
|
||||
>
|
||||
<Icon icon={faUndo} />
|
||||
</OperationButton>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue