diff --git a/StashPluginHelper/StashPluginHelper.py b/StashPluginHelper/StashPluginHelper.py index 7301f0f..109574f 100644 --- a/StashPluginHelper/StashPluginHelper.py +++ b/StashPluginHelper/StashPluginHelper.py @@ -122,13 +122,16 @@ 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: self.DRY_RUN = self.pluginConfig[DryRunFieldName] - + if len(sys.argv) > 1: RUNNING_IN_COMMAND_LINE_MODE = True if not debugTracing or not stash_url: diff --git a/plugins/DupFileManager/StashPluginHelper.py b/plugins/DupFileManager/StashPluginHelper.py index 7301f0f..109574f 100644 --- a/plugins/DupFileManager/StashPluginHelper.py +++ b/plugins/DupFileManager/StashPluginHelper.py @@ -122,13 +122,16 @@ 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: self.DRY_RUN = self.pluginConfig[DryRunFieldName] - + if len(sys.argv) > 1: RUNNING_IN_COMMAND_LINE_MODE = True if not debugTracing or not stash_url: diff --git a/plugins/FileMonitor/README.md b/plugins/FileMonitor/README.md index 0c3457b..8b0dc79 100644 --- a/plugins/FileMonitor/README.md +++ b/plugins/FileMonitor/README.md @@ -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**. diff --git a/plugins/FileMonitor/StashPluginHelper.py b/plugins/FileMonitor/StashPluginHelper.py index 7301f0f..109574f 100644 --- a/plugins/FileMonitor/StashPluginHelper.py +++ b/plugins/FileMonitor/StashPluginHelper.py @@ -122,13 +122,16 @@ 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: self.DRY_RUN = self.pluginConfig[DryRunFieldName] - + if len(sys.argv) > 1: RUNNING_IN_COMMAND_LINE_MODE = True if not debugTracing or not stash_url: diff --git a/plugins/FileMonitor/filemonitor.yml b/plugins/FileMonitor/filemonitor.yml index b30f935..bd8d5b5 100644 --- a/plugins/FileMonitor/filemonitor.yml +++ b/plugins/FileMonitor/filemonitor.yml @@ -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: diff --git a/plugins/FileMonitor/filemonitor_config.py b/plugins/FileMonitor/filemonitor_config.py index add1c3d..4692c3a 100644 --- a/plugins/FileMonitor/filemonitor_config.py +++ b/plugins/FileMonitor/filemonitor_config.py @@ -100,6 +100,8 @@ config = { # {"task" : "execute", "command" : "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.