File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
ui/v2.5/src/components/Performers/PerformerDetails Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,22 @@ export const PerformerScrapeDialog: React.FC<IPerformerScrapeDialogProps> = (
146146 return ;
147147 }
148148
149+ // #6257 - it is possible (though unsupported) to have multiple stash IDs for the same
150+ // endpoint; in that case, we should prefer the one matching the scraped remote site ID
151+ // if it exists
152+ const stashIDs = ( props . performer . stash_ids ?? [ ] ) . filter (
153+ ( s ) => s . endpoint === endpoint
154+ ) ;
155+ if ( stashIDs . length > 1 && props . scraped . remote_site_id ) {
156+ const matchingID = stashIDs . find (
157+ ( s ) => s . stash_id === props . scraped . remote_site_id
158+ ) ;
159+ if ( matchingID ) {
160+ return matchingID . stash_id ;
161+ }
162+ }
163+
164+ // otherwise, return the first stash ID for the endpoint
149165 return props . performer . stash_ids ?. find ( ( s ) => s . endpoint === endpoint )
150166 ?. stash_id ;
151167 }
You can’t perform that action at this time.
0 commit comments