fix(javstashAutofill): correct name casing, store the stash-box id, simplify the source setting - #774
Open
dude-stash wants to merge 1 commit into
Open
fix(javstashAutofill): correct name casing, store the stash-box id, simplify the source setting#774dude-stash wants to merge 1 commit into
dude-stash wants to merge 1 commit into
Conversation
…d, simplify the source setting Three fixes, all reported in stashapp#773. 1. The primary name was never replaced when the typed name and the scraper name differed only in casing or spacing. The rename check compared the names through norm(), which lowercases and strips spaces, so "yua mikami" and "Yua Mikami" looked identical and the rename was skipped. A casing/spacing difference is now always corrected to the scraper's spelling; a genuinely different name still needs the "use scraper name as primary" toggle. 2. The scrape never requested remote_site_id, so the stash-box id of the matched performer could not be stored. It is now requested and written into stash_ids (fill, rename and merge paths), so Identify and the Tagger recognise the performer afterwards. The modern urls list is requested too - build_update() read cand["url"], which was never fetched. 3. The source setting required the full stash-box endpoint URL, even though Stash knows its own endpoints, and only accepts one that matches a configured endpoint exactly - a trailing slash or a wrong path failed with "stash box not found". resolve_source() now matches the value against configuration.general.stashBoxes and listScrapers(types: [PERFORMER]), so a stash-box name ("StashDB"), part of a name or endpoint ("stashdb"), a performer scraper name or id, or a full URL all work. Empty falls back to javstash when configured, otherwise the first configured stash-box. The resolved source is named in the log. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
@suzuhiroruri Love the plugin, its been very helpful. I added a few improvements. :) |
|
This pull request has been mentioned on Stash Forum. There might be relevant details there: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #773. Three fixes for Javstash Autofill, version bumped to 1.4.
1. The name is now corrected to the scraper's spelling
I usually type performer names without the right casing, and the plugin never fixed them. The rename check was:
norm()lowercases and strips spaces, soyua mikamiandYua Mikamiare equal there and nothing happens.Now:
A difference in casing or spacing is always corrected, because it is the same name. A really different name still needs the "use scraper name as primary" toggle, as before.
find_by_name()compares withnorm()now as well, so an existing "Yua Mikami" is found as the duplicate and merged, instead of the rename hitting it.2. The stash-box id is stored
remote_site_idwas missing from the scrape query, so the id was never available. It is requested now and, when the source is a stash-box, written intostash_idsin all three paths (fill, rename, merge), without touching ids from other endpoints. Identify and the Tagger recognise the performer after autofill.urlswas added to the query too, becausebuild_update()was readingcand.get("url")and that field was never fetched.3. The source setting no longer needs the endpoint URL
Before, the setting wanted the full endpoint URL that Stash already has under Settings → Metadata Providers. Worse,
resolveStashBoxonly accepts an endpoint that matches a configured one exactly, so a trailing slash or a small typo failed with "stash box not found" and the hook only logged a scrape error.resolve_source()now looks the value up inconfiguration.general.stashBoxesandlistScrapers(types: [PERFORMER]), in this order:StashDBstashdbMinnano-AV-JPEmpty uses javstash if it is configured, otherwise the first configured stash-box. The log line now says which source was used, for example
via stash-box 'StashDB' (by name).Old values keep working: a full URL and a
scraper_idare still accepted, so nobody has to change their settings.Testing
stash_ids, and the fields filled.node validate.js plugins/javstashAutofill/javstashAutofill.ymlpasses.README and CHANGELOG updated.
AI assistance was used for this change.