File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
plugins/performerStashboxUrlToID Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 22from stashapi .stashapp import StashInterface
33import sys
44import json
5+ import uuid
56
67STASH_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
1315def 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" ]))
Original file line number Diff line number Diff line change 11name : Performer Stashbox Url to ID
22description : 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
44url : https://github.com/stashapp/CommunityScripts/
55exec :
66 - python
77 - " {pluginDir}/performerStashboxUrlToID.py"
88interface : raw
99hooks :
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
You can’t perform that action at this time.
0 commit comments