Skip to content

Commit

Permalink
TPDB domain change (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
MyDirtyAccount authored Mar 6, 2024
1 parent 0eec56a commit 56562e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions plugins/TPBDMarkers/TPDBMarkers.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: The Porn DB Markers
description: Sync Markers from The Porn DB aka metadataapi.net
version: 0.1
description: Sync Markers from The Porn DB aka theporndb.net
version: 0.2
url: https://github.com/stashapp/CommunityScripts/
exec:
- python
- "{pluginDir}/tpdbMarkers.py"
interface: raw
hooks:
- name: Add Marker to Scene
description: Makes Markers checking against The Porn DB aka metadataapi.net
description: Makes Markers checking against The Porn DB aka theporndb.net
triggeredBy:
- Scene.Update.Post

Expand All @@ -19,6 +19,6 @@ settings:

tasks:
- name: "Sync"
description: Get markers for all scenes with a stashid from metadataapi.net and no markers
description: Get markers for all scenes with a stashid from theporndb.net and no markers
defaultArgs:
mode: processScene
12 changes: 6 additions & 6 deletions plugins/TPBDMarkers/tpdbMarkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

def processScene(scene):
for sid in scene["stash_ids"]:
if sid["endpoint"] == "https://metadataapi.net/graphql":
if sid["endpoint"] == "https://theporndb.net/graphql":
log.debug("Scene has a TPDB stash id, looking up %s " % (sid["stash_id"],))
res = request_s.get(
"https://api.metadataapi.net/scenes/%s" % (sid["stash_id"],)
"https://api.theporndb.net/scenes/%s" % (sid["stash_id"],)
)
if res.status_code == 200:
if "data" in res.json():
Expand Down Expand Up @@ -46,7 +46,7 @@ def processAll():
count = stash.find_scenes(
f={
"stash_id_endpoint": {
"endpoint": "https://metadataapi.net/graphql",
"endpoint": "https://theporndb.net/graphql",
"modifier": "NOT_NULL",
"stash_id": "",
},
Expand Down Expand Up @@ -75,7 +75,7 @@ def processAll():
scenes = stash.find_scenes(
f={
"stash_id_endpoint": {
"endpoint": "https://metadataapi.net/graphql",
"endpoint": "https://theporndb.net/graphql",
"modifier": "NOT_NULL",
"stash_id": "",
},
Expand Down Expand Up @@ -104,11 +104,11 @@ def processAll():
log.debug("settings: %s " % (settings,))

# Set up the auth token for tpdb
if "https://metadataapi.net/graphql" in [
if "https://theporndb.net/graphql" in [
x["endpoint"] for x in stash.get_configuration()["general"]["stashBoxes"]
]:
for x in stash.get_configuration()["general"]["stashBoxes"]:
if x["endpoint"] == "https://metadataapi.net/graphql":
if x["endpoint"] == "https://theporndb.net/graphql":
request_s.headers["Authorization"] = "Bearer %s" % (x["api_key"],)

if "mode" in json_input["args"]:
Expand Down

0 comments on commit 56562e7

Please sign in to comment.