mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Plugin hooks (#1452)
* Refactor session and plugin code * Add context to job tasks * Show hooks in plugins page * Refactor session management
This commit is contained in:
@@ -17,7 +17,10 @@ class StashInterface:
|
||||
|
||||
self.url = scheme + "://localhost:" + str(self.port) + "/graphql"
|
||||
|
||||
# TODO - cookies
|
||||
# Session cookie for authentication
|
||||
self.cookies = {
|
||||
'session': conn.get('SessionCookie').get('Value')
|
||||
}
|
||||
|
||||
def __callGraphQL(self, query, variables = None):
|
||||
json = {}
|
||||
@@ -26,7 +29,7 @@ class StashInterface:
|
||||
json['variables'] = variables
|
||||
|
||||
# handle cookies
|
||||
response = requests.post(self.url, json=json, headers=self.headers)
|
||||
response = requests.post(self.url, json=json, headers=self.headers, cookies=self.cookies)
|
||||
|
||||
if response.status_code == 200:
|
||||
result = response.json()
|
||||
|
||||
Reference in New Issue
Block a user