Skip to content

Commit 1dfcb20

Browse files
Add TPDB to list of valid domains
This adds the TPDB domain to the list of valid stash boxes that can be detected by the "PerformerStashboxUrlToID" plugin. Because TPDB has multiple possible perfromer links, we need to add a check specific for links with the `/performers/` prefix that Stash-Box expects. This also adds a UUID check to make sure the Stash-Box ID is in the correct format, since TPDB is also a bit more relaxed about that.
1 parent 625bfa8 commit 1dfcb20

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
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"]))

0 commit comments

Comments
 (0)