From c78aa7d99c850720f4044b670831c4d599f52dac Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Fri, 14 Nov 2025 12:59:29 +1100 Subject: [PATCH] Fix inconsistency when scraping performer with multiple stash ids from same endpoint (#6260) (cherry picked from commit bc91ca0a2574e155c209743bebaf0bc99e416daa) --- .../PerformerDetails/PerformerScrapeDialog.tsx | 16 ++++++++++++++++ ui/v2.5/src/docs/en/Changelog/v0290.md | 1 + 2 files changed, 17 insertions(+) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerScrapeDialog.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerScrapeDialog.tsx index eb5f26a83..0398f1eec 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerScrapeDialog.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerScrapeDialog.tsx @@ -146,6 +146,22 @@ export const PerformerScrapeDialog: React.FC = ( return; } + // #6257 - it is possible (though unsupported) to have multiple stash IDs for the same + // endpoint; in that case, we should prefer the one matching the scraped remote site ID + // if it exists + const stashIDs = (props.performer.stash_ids ?? []).filter( + (s) => s.endpoint === endpoint + ); + if (stashIDs.length > 1 && props.scraped.remote_site_id) { + const matchingID = stashIDs.find( + (s) => s.stash_id === props.scraped.remote_site_id + ); + if (matchingID) { + return matchingID.stash_id; + } + } + + // otherwise, return the first stash ID for the endpoint return props.performer.stash_ids?.find((s) => s.endpoint === endpoint) ?.stash_id; } diff --git a/ui/v2.5/src/docs/en/Changelog/v0290.md b/ui/v2.5/src/docs/en/Changelog/v0290.md index 8092045b0..62ea2bca0 100644 --- a/ui/v2.5/src/docs/en/Changelog/v0290.md +++ b/ui/v2.5/src/docs/en/Changelog/v0290.md @@ -34,6 +34,7 @@ * Include IP address in login errors in log. ([#5760](https://github.com/stashapp/stash/pull/5760)) ### 🐛 Bug fixes +* **[0.29.4]** Fixed existing match stash ID sometimes not being displayed in the performer scrape dialog. ([#6257](https://github.com/stashapp/stash/pull/6257)) * **[0.29.4]** Fixed inline videos showing as full-screen on iPhone devices. ([#6259](https://github.com/stashapp/stash/pull/6259)) * **[0.29.4]** Fixed download backup function not working when generated directory is on a different filesystem. ([#6244](https://github.com/stashapp/stash/pull/6244)) * **[0.29.3]** Fixed sidebar filter contents not loading. ([#6240](https://github.com/stashapp/stash/pull/6240))