forked from Github/Axter-Stash
Added API Key functionality
This commit is contained in:
@@ -122,8 +122,11 @@ class StashPluginHelper(StashInterface):
|
||||
self.FRAGMENT_SERVER = {'Scheme': 'http', 'Host': '0.0.0.0', 'Port': '9999', 'SessionCookie': {'Name': 'session', 'Value': '', 'Path': '', 'Domain': '', 'Expires': '0001-01-01T00:00:00Z', 'RawExpires': '', 'MaxAge': 0, 'Secure': False, 'HttpOnly': False, 'SameSite': 0, 'Raw': '', 'Unparsed': None}, 'Dir': os.path.dirname(pathlib.Path(self.MAIN_SCRIPT_NAME).resolve().parent), 'PluginDir': pathlib.Path(self.MAIN_SCRIPT_NAME).resolve().parent}
|
||||
|
||||
if debugTracing: self.DEBUG_TRACING = debugTracing
|
||||
apiKey = ""
|
||||
if config:
|
||||
self.pluginConfig = config
|
||||
if 'apiKey' in self.pluginConfig and self.pluginConfig['apiKey'] != "":
|
||||
self.FRAGMENT_SERVER['ApiKey'] = self.pluginConfig['apiKey']
|
||||
if DebugTraceFieldName in self.pluginConfig:
|
||||
self.DEBUG_TRACING = self.pluginConfig[DebugTraceFieldName]
|
||||
if DryRunFieldName in self.pluginConfig:
|
||||
|
||||
@@ -122,8 +122,11 @@ class StashPluginHelper(StashInterface):
|
||||
self.FRAGMENT_SERVER = {'Scheme': 'http', 'Host': '0.0.0.0', 'Port': '9999', 'SessionCookie': {'Name': 'session', 'Value': '', 'Path': '', 'Domain': '', 'Expires': '0001-01-01T00:00:00Z', 'RawExpires': '', 'MaxAge': 0, 'Secure': False, 'HttpOnly': False, 'SameSite': 0, 'Raw': '', 'Unparsed': None}, 'Dir': os.path.dirname(pathlib.Path(self.MAIN_SCRIPT_NAME).resolve().parent), 'PluginDir': pathlib.Path(self.MAIN_SCRIPT_NAME).resolve().parent}
|
||||
|
||||
if debugTracing: self.DEBUG_TRACING = debugTracing
|
||||
apiKey = ""
|
||||
if config:
|
||||
self.pluginConfig = config
|
||||
if 'apiKey' in self.pluginConfig and self.pluginConfig['apiKey'] != "":
|
||||
self.FRAGMENT_SERVER['ApiKey'] = self.pluginConfig['apiKey']
|
||||
if DebugTraceFieldName in self.pluginConfig:
|
||||
self.DEBUG_TRACING = self.pluginConfig[DebugTraceFieldName]
|
||||
if DryRunFieldName in self.pluginConfig:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# FileMonitor: Ver 0.8.3 (By David Maisonave)
|
||||
# FileMonitor: Ver 0.8.4 (By David Maisonave)
|
||||
FileMonitor is a [Stash](https://github.com/stashapp/stash) plugin with the following two main features:
|
||||
- Updates Stash when any file changes occurs in the Stash library.
|
||||
- **Task Scheduler**: Runs scheduled task based on the scheduler configuration in **filemonitor_config.py**.
|
||||
|
||||
@@ -122,8 +122,11 @@ class StashPluginHelper(StashInterface):
|
||||
self.FRAGMENT_SERVER = {'Scheme': 'http', 'Host': '0.0.0.0', 'Port': '9999', 'SessionCookie': {'Name': 'session', 'Value': '', 'Path': '', 'Domain': '', 'Expires': '0001-01-01T00:00:00Z', 'RawExpires': '', 'MaxAge': 0, 'Secure': False, 'HttpOnly': False, 'SameSite': 0, 'Raw': '', 'Unparsed': None}, 'Dir': os.path.dirname(pathlib.Path(self.MAIN_SCRIPT_NAME).resolve().parent), 'PluginDir': pathlib.Path(self.MAIN_SCRIPT_NAME).resolve().parent}
|
||||
|
||||
if debugTracing: self.DEBUG_TRACING = debugTracing
|
||||
apiKey = ""
|
||||
if config:
|
||||
self.pluginConfig = config
|
||||
if 'apiKey' in self.pluginConfig and self.pluginConfig['apiKey'] != "":
|
||||
self.FRAGMENT_SERVER['ApiKey'] = self.pluginConfig['apiKey']
|
||||
if DebugTraceFieldName in self.pluginConfig:
|
||||
self.DEBUG_TRACING = self.pluginConfig[DebugTraceFieldName]
|
||||
if DryRunFieldName in self.pluginConfig:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: FileMonitor
|
||||
description: Monitors the Stash library folders, and updates Stash if any changes occurs in the Stash library paths.
|
||||
version: 0.8.3
|
||||
version: 0.8.4
|
||||
url: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/FileMonitor
|
||||
settings:
|
||||
recursiveDisabled:
|
||||
|
||||
@@ -100,6 +100,8 @@ config = {
|
||||
# {"task" : "execute", "command" : "<plugin_path>test_hello_world.bat", "args" : "--name David", "weekday" : "friday", "time" : "12:03"}, # Does NOT show up in the Task Queue. Check FileMonitor log file, and look for -> Task 'execute' result=???
|
||||
],
|
||||
|
||||
# ApiKey only needed when Stash credentials are set.
|
||||
"apiKey" : "", # Example: "eyJabccideJIUfg1NigRInD345I6dfpXVCfd.eyJ1abcDEfGheHRlHJiJklMonPQ32FsVewtsfSIsImlhdCI6MTcyMzg2NzkwOH0.5bkHU6sfs3532dsryu1ki3iFBwnd_4AHs325yHljsPw"
|
||||
# Timeout in seconds. This is how often FileMonitor will check the scheduler and (in-plugin mode) check if another job (Task) is in the queue.
|
||||
"timeOut": 60,
|
||||
# Enable to run metadata clean task after file deletion.
|
||||
|
||||
Reference in New Issue
Block a user