Skip to content

[Javstash Autofill] Scraped name never replaces the typed name; stash-box id is not stored; source needs a URL Stash already has #773

Description

@dude-stash

Plugin: Javstash Autofill v1.3 (plugins/javstashAutofill/javstash_autofill.py)

Three separate problems. I have a fix for all three and will open a PR.

1. The scraper's name never replaces the created name

With use scraper name as primary enabled, a performer whose name I typed in lowercase keeps the lowercase name. The rename is gated on:

prefer_scraper = bool(use_scraper_name) and bool(cand_name) and norm(cand_name) != norm(name)

norm() lowercases and strips spaces, so yua mikami and Yua Mikami compare equal and the rename is skipped. Only a genuinely different name triggers it — a casing or spacing difference, which is the common case when typing a name by hand, never does.

Expected: the primary name is corrected to the scraper's spelling. A casing-only correction is arguably safe even with the toggle off, since it is the same name.

2. The stash-box id is not stored

When the source is a stash-box, the matched performer's remote id is never written to stash_ids. The scrape query does not ask for it:

JAV_FIELDS = ("name gender birthdate death_date ethnicity country hair_color eye_color "
              "height weight measurements fake_tits career_length tattoos piercings "
              "details twitter instagram aliases images")

remote_site_id is missing, so the id is not available to the update at all. After autofill the performer still has no stash id, and Identify / the Tagger do not recognise it afterwards.

Related, same query: build_update() reads cand.get("url"), but neither url nor the modern urls list is requested, so scraped URLs other than twitter/instagram are always dropped.

3. Configuring the source is harder than it needs to be

Scraper (Identify) and Scraper (manual) want a full stash-box endpoint URL, which Stash already knows from Settings → Metadata Providers:

def build_source(source_str):
    # A URL is treated as a stash-box endpoint; anything else as a scraper_id.
    s = (source_str or JAV).strip()
    return {"stash_box_endpoint": s} if s.startswith("http") else {"scraper_id": s}

Retyping the URL is also a silent failure mode: resolveStashBox in stash only accepts an endpoint matching a configured one exactly (case-insensitively), so a trailing slash or a slightly wrong path fails with "stash box not found" and the hook only logs a scrape error.

Proposal: resolve the setting against configuration.general.stashBoxes and listScrapers(types: [PERFORMER]), so the value may be a stash-box name (StashDB), part of a name or endpoint (stashdb), a performer scraper name or id, or still a full URL. Empty falls back to javstash when configured, otherwise the first configured stash-box.

Steps to reproduce (1 and 2)

  1. Configure a stash-box (e.g. StashDB) under Settings → Metadata Providers and set it as the plugin's manual source.
  2. Turn on Manual - use scraper name as primary.
  3. Create a performer manually, typing the name in lowercase (yua mikami).
  4. The fields are filled from the scraper, but the name stays yua mikami and no stash id is added.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions