|
10 | 10 | per_page = 100 |
11 | 11 | request_s = requests.Session() |
12 | 12 |
|
| 13 | +TPDB_ENDPOINT = "https://theporndb.net/graphql" |
13 | 14 |
|
14 | 15 | def processScene(scene): |
15 | 16 | for sid in scene["stash_ids"]: |
16 | | - if sid["endpoint"] == "https://theporndb.net/graphql": |
| 17 | + if sid["endpoint"] == TPDB_ENDPOINT: |
17 | 18 | log.debug("Scene has a TPDB stash id, looking up %s " % (sid["stash_id"],)) |
18 | 19 | res = request_s.get( |
19 | 20 | "https://api.theporndb.net/scenes/%s" % (sid["stash_id"],) |
@@ -58,7 +59,7 @@ def processAll(): |
58 | 59 | count = stash.find_scenes( |
59 | 60 | f={ |
60 | 61 | "stash_id_endpoint": { |
61 | | - "endpoint": "https://theporndb.net/graphql", |
| 62 | + "endpoint": TPDB_ENDPOINT, |
62 | 63 | "modifier": "NOT_NULL", |
63 | 64 | "stash_id": "", |
64 | 65 | }, |
@@ -87,7 +88,7 @@ def processAll(): |
87 | 88 | scenes = stash.find_scenes( |
88 | 89 | f={ |
89 | 90 | "stash_id_endpoint": { |
90 | | - "endpoint": "https://theporndb.net/graphql", |
| 91 | + "endpoint": TPDB_ENDPOINT, |
91 | 92 | "modifier": "NOT_NULL", |
92 | 93 | "stash_id": "", |
93 | 94 | }, |
@@ -160,11 +161,11 @@ def processMovie(m): |
160 | 161 | log.debug("settings: %s " % (settings,)) |
161 | 162 |
|
162 | 163 | # Set up the auth token for tpdb |
163 | | -if "https://theporndb.net/graphql" in [ |
| 164 | +if TPDB_ENDPOINT in [ |
164 | 165 | x["endpoint"] for x in stash.get_configuration()["general"]["stashBoxes"] |
165 | 166 | ]: |
166 | 167 | for x in stash.get_configuration()["general"]["stashBoxes"]: |
167 | | - if x["endpoint"] == "https://theporndb.net/graphql": |
| 168 | + if x["endpoint"] == TPDB_ENDPOINT: |
168 | 169 | request_s.headers["Authorization"] = "Bearer %s" % (x["api_key"],) |
169 | 170 |
|
170 | 171 | if "mode" in json_input["args"]: |
|
0 commit comments