-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix performer stash ids being overwritten in performer tagger (#4215)
- Loading branch information
1 parent
5e0f27b
commit a9ab1fc
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
import { StashIdInput } from "src/core/generated-graphql"; | ||
|
||
export function stashboxDisplayName(name: string, index: number) { | ||
return name || `Stash-Box #${index + 1}`; | ||
} | ||
|
||
export const getStashboxBase = (endpoint: string) => | ||
endpoint.match(/(https?:\/\/.*?\/)graphql/)?.[1]; | ||
|
||
// mergeStashIDs merges the src stash ID into the dest stash IDs. | ||
// If the src stash ID is already in dest, the src stash ID overwrites the dest stash ID. | ||
export function mergeStashIDs(dest: StashIdInput[], src: StashIdInput[]) { | ||
return dest | ||
.filter((i) => !src.find((j) => i.endpoint === j.endpoint)) | ||
.concat(src); | ||
} |