Skip to content

Commit 279c985

Browse files
[PerformerStashboxUrlToID] Support TPDB performer URLs (#606)
1 parent 445bbe2 commit 279c985

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

plugins/performerStashboxUrlToID/performerStashboxUrlToID.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
from stashapi.stashapp import StashInterface
33
import sys
44
import json
5+
import uuid
56

67
STASH_BOXES = [
78
"https://fansdb.cc",
89
"https://pmvstash.org",
910
"https://stashdb.org",
10-
"https://javstash.org"
11+
"https://javstash.org",
12+
"https://theporndb.net",
1113
]
1214

1315
def processPerformer(performer):
@@ -18,9 +20,15 @@ def processPerformer(performer):
1820
for url in performer["urls"]:
1921
log.trace(url)
2022
for domain in STASH_BOXES:
21-
if domain in url and f"{domain}/graphql" not in stash_boxes:
23+
if f"{domain}/performers/" in url and f"{domain}/graphql" not in stash_boxes:
24+
try:
25+
stash_box_id = url.rstrip("/").rsplit("/", 1)[1]
26+
stash_box_id = str(uuid.UUID(stash_box_id, version=4))
27+
except ValueError:
28+
continue
29+
2230
performer_update["stash_ids"].append(
23-
{"endpoint": f"{domain}/graphql", "stash_id": url[-36:]}
31+
{"endpoint": f"{domain}/graphql", "stash_id": stash_box_id}
2432
)
2533
needs_update = True
2634
log.info("Adding stashbox %s to performer %s" % (domain, performer["id"]))

plugins/performerStashboxUrlToID/performerStashboxUrlToID.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Performer Stashbox Url to ID
22
description: If the performer has a url for another stashbox add it as an id to the performer
3-
version: 0.2
3+
version: 0.3
44
url: https://github.com/stashapp/CommunityScripts/
55
exec:
66
- python
77
- "{pluginDir}/performerStashboxUrlToID.py"
88
interface: raw
99
hooks:
1010
- name: Process Performer
11-
description: Adds extra tags to scenes
11+
description: Adds/updates stashbox IDs based on the performer URLs
1212
triggeredBy:
1313
- Performer.Update.Post
1414
- Performer.Create.Post

0 commit comments

Comments
 (0)