Skip to content

Comments

Manually Search Stash ID - Edit Page - Scenes, Studios#6340

Merged
WithoutPants merged 8 commits intostashapp:developfrom
Gykes:manual-stashID-Search
Dec 3, 2025
Merged

Manually Search Stash ID - Edit Page - Scenes, Studios#6340
WithoutPants merged 8 commits intostashapp:developfrom
Gykes:manual-stashID-Search

Conversation

@Gykes
Copy link
Collaborator

@Gykes Gykes commented Nov 28, 2025

A followup to #6284

This adds in the same support to the other modals that support StashIDs: Scenes, Studios, and Tags.

Closes: #6271

@Gykes Gykes force-pushed the manual-stashID-Search branch from 9101ecc to f4936fb Compare November 28, 2025 07:06
lint
@Gykes Gykes force-pushed the manual-stashID-Search branch from 2d7dfd5 to 66d55e3 Compare November 28, 2025 07:12
@Gykes Gykes requested a review from WithoutPants November 28, 2025 07:13
@Gykes
Copy link
Collaborator Author

Gykes commented Nov 28, 2025

I modified some of the old code in the performers section to run off of the new utility. All 4 sections were doing the same thing so I figured it was best to break it out.

@Gykes Gykes changed the title Feature Request: Manually Add StashId Search for Scenes, Studios, and Tags Manually Search Stash ID - Edit Page - Scenes, Studios, Tags Nov 28, 2025
@Gykes Gykes added the needs testing Pull requests that require testing label Nov 28, 2025
Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please extract the tag part of this PR into a separate one? It's looking like the scenes and studio stuff is ready to go, but the tag stuff still needs work.

return nil, nil
}

return nil, errors.New("stash_box_index must be set")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should refer to the non-deprecated field stash_box_endpoint instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 10 to 36
func (c Client) FindTag(ctx context.Context, query string) (*models.ScrapedTag, error) {
var id *string
var name *string

_, err := uuid.Parse(query)
if err == nil {
// Confirmed the user passed in a Stash ID
id = &query
} else {
// Otherwise assume they're searching on a name
name = &query
}

tag, err := c.client.FindTag(ctx, id, name)
if err != nil {
return nil, err
}

if tag.FindTag == nil {
return nil, nil
}

return &models.ScrapedTag{
Name: tag.FindTag.Name,
RemoteSiteID: &tag.FindTag.ID,
}, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be returning a slice of tags rather than a single one. In the UI, we're potentially querying for a tag for which we may not have the exact name, similar to performers, scenes etc. I think if we're not searching by UUID, we should use queryTags instead of findTag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving over to separate PR as requested to fix.

@WithoutPants WithoutPants added this to the Version 0.30.0 milestone Dec 2, 2025
@Gykes Gykes changed the title Manually Search Stash ID - Edit Page - Scenes, Studios, Tags Manually Search Stash ID - Edit Page - Scenes, Studios Dec 3, 2025
@Gykes Gykes requested a review from WithoutPants December 3, 2025 20:35
Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly there. Testing looks good.

Comment on lines 236 to 245
function getEntityTypeDisplayName(entityType: StashBoxEntityType): string {
switch (entityType) {
case "performer":
return "Performer";
case "scene":
return "Scene";
case "studio":
return "Studio";
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be internationalised as well. This should return a message id, which would be translated using intl in the calling code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to google what that even meant but I think I was able to copy it over from how another part handled it.

@Gykes
Copy link
Collaborator Author

Gykes commented Dec 3, 2025

I branched the tags stuff off of this one a little earlier. Once this one looks good I will rebase with any changes we make and then PR it.

@WithoutPants WithoutPants merged commit 877491e into stashapp:develop Dec 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs testing Pull requests that require testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add StashIDs Manually in UI for all Objects

2 participants