forked from Github/Axter-Stash
Changed Plugin name
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
# ChangeFileMonitor: Ver 0.1.0 (By David Maisonave)
|
||||
ChangeFileMonitor is a [Stash](https://github.com/stashapp/stash) plugin which updates Stash if any changes occurs in the Stash library paths.
|
||||
|
||||
### Using ChangeFileMonitor as a plugin
|
||||
- To start monitoring file changes, go to **Stash->Settings->Task->[Plugin Tasks]->ChangeFileMonitor**, and click on the [Start Library Monitor] button.
|
||||
- 
|
||||
- To stop this task, go to **Stash->Settings->Task->[Task Queue]**, and click on the **[x]**.
|
||||
- 
|
||||
|
||||
### Using ChangeFileMonitor as a script
|
||||
**ChangeFileMonitor** can be called as a standalone script.
|
||||
- To start monitoring call the script and pass any argument.
|
||||
- python changefilemonitor.py **foofoo**
|
||||
- To stop **ChangeFileMonitor**, pass argument **stop**.
|
||||
- python changefilemonitor.py **stop**
|
||||
- After running above command line, **ChangeFileMonitor** will stop after the next file change occurs.
|
||||
- The stop command works to stop the standalone job and the Stash plugin task job.
|
||||
|
||||
### Requirements
|
||||
`pip install stashapp-tools`
|
||||
`pip install pyYAML`
|
||||
`pip install watchdog`
|
||||
|
||||
### Installation
|
||||
- Follow **Requirements** instructions.
|
||||
- In the stash plugin directory (C:\Users\MyUserName\.stash\plugins), create a folder named **ChangeFileMonitor**.
|
||||
- Copy all the plugin files to this folder.(**C:\Users\MyUserName\\.stash\plugins\ChangeFileMonitor**).
|
||||
- Restart Stash.
|
||||
|
||||
That's it!!!
|
||||
|
||||
### Options
|
||||
- All options are accessible in the GUI via Settings->Plugins->Plugins->[ChangeFileMonitor].
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
id: changefilemonitor
|
||||
name: ChangeFileMonitor
|
||||
metadata:
|
||||
description: Monitors the Stash library folders, and updates Stash if any changes occurs in the Stash library paths.
|
||||
version: 0.1.0
|
||||
date: "2024-07-26 08:00:00"
|
||||
requires: [pip install stashapp-tools, pip install pyYAML, pip install watchdog]
|
||||
source_repository: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/ChangeFileMonitor
|
||||
files:
|
||||
- README.md
|
||||
- changefilemonitor.yml
|
||||
- changefilemonitor.py
|
||||
- requirements.txt
|
||||
35
plugins/FileMonitor/README.md
Normal file
35
plugins/FileMonitor/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# FileMonitor: Ver 0.1.0 (By David Maisonave)
|
||||
FileMonitor is a [Stash](https://github.com/stashapp/stash) plugin which updates Stash if any changes occurs in the Stash library paths.
|
||||
|
||||
### Using FileMonitor as a plugin
|
||||
- To start monitoring file changes, go to **Stash->Settings->Task->[Plugin Tasks]->FileMonitor**, and click on the [Start Library Monitor] button.
|
||||
- 
|
||||
- To stop this task, go to **Stash->Settings->Task->[Task Queue]**, and click on the **[x]**.
|
||||
- 
|
||||
|
||||
### Using FileMonitor as a script
|
||||
**FileMonitor** can be called as a standalone script.
|
||||
- To start monitoring call the script and pass any argument.
|
||||
- python filemonitor.py **start**
|
||||
- To stop **FileMonitor**, pass argument **stop**.
|
||||
- python filemonitor.py **stop**
|
||||
- After running above command line, **FileMonitor** will stop after the next file change occurs.
|
||||
- The stop command works to stop the standalone job and the Stash plugin task job.
|
||||
|
||||
### Requirements
|
||||
`pip install stashapp-tools`
|
||||
`pip install pyYAML`
|
||||
`pip install watchdog`
|
||||
|
||||
### Installation
|
||||
- Follow **Requirements** instructions.
|
||||
- In the stash plugin directory (C:\Users\MyUserName\.stash\plugins), create a folder named **FileMonitor**.
|
||||
- Copy all the plugin files to this folder.(**C:\Users\MyUserName\\.stash\plugins\FileMonitor**).
|
||||
- Restart Stash.
|
||||
|
||||
That's it!!!
|
||||
|
||||
### Options
|
||||
- All options are accessible in the GUI via Settings->Plugins->Plugins->[FileMonitor].
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Description: This is a Stash plugin which updates Stash if any changes occurs in the Stash library paths.
|
||||
# By David Maisonave (aka Axter) Jul-2024 (https://www.axter.com/)
|
||||
# Get the latest developers version from following link: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/ChangeFileMonitor
|
||||
# Get the latest developers version from following link: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/FileMonitor
|
||||
# Note: To call this script outside of Stash, pass any argument.
|
||||
# Example: python changefilemonitor.py foofoo
|
||||
# Example: python filemonitor.py foofoo
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
@@ -20,7 +20,7 @@ from watchdog.observers import Observer # This is also needed for event attribut
|
||||
import watchdog # pip install watchdog # https://pythonhosted.org/watchdog/
|
||||
from threading import Lock, Condition
|
||||
from multiprocessing import shared_memory
|
||||
from changefilemonitor_config import config # Import settings from changefilemonitor_config.py
|
||||
from filemonitor_config import config # Import settings from filemonitor_config.py
|
||||
|
||||
# **********************************************************************
|
||||
# Constant global variables --------------------------------------------
|
||||
@@ -64,7 +64,7 @@ logger = logging.getLogger(Path(__file__).stem)
|
||||
|
||||
# **********************************************************************
|
||||
# ----------------------------------------------------------------------
|
||||
# Code section to fetch variables from Plugin UI and from changefilemonitor_settings.py
|
||||
# Code section to fetch variables from Plugin UI and from filemonitor_settings.py
|
||||
# Check if being called as Stash plugin
|
||||
gettingCalledAsStashPlugin = True
|
||||
stopLibraryMonitoring = False
|
||||
@@ -147,7 +147,7 @@ def start_library_monitor():
|
||||
global TargetPaths
|
||||
try:
|
||||
# Create shared memory buffer which can be used as singleton logic or to get a signal to quit task from external script
|
||||
shm_a = shared_memory.SharedMemory(name="DavidMaisonaveAxter_ChangeFileMonitor", create=True, size=4)
|
||||
shm_a = shared_memory.SharedMemory(name="DavidMaisonaveAxter_FileMonitor", create=True, size=4)
|
||||
except:
|
||||
pass
|
||||
logger.info("Could not open shared memory map. Change File Monitor must be running. Can not run multiple instance of Change File Monitor.")
|
||||
@@ -256,13 +256,13 @@ def start_library_monitor():
|
||||
if debugTracing: logger.info("Exiting function................")
|
||||
|
||||
# This function is only useful when called outside of Stash.
|
||||
# Example: python changefilemonitor.py stop
|
||||
# Example: python filemonitor.py stop
|
||||
# Stops monitoring after triggered by the next file change.
|
||||
# ToDo: Add logic so it doesn't have to wait until the next file change
|
||||
def stop_library_monitor():
|
||||
if debugTracing: logger.info("Opening shared memory map.")
|
||||
try:
|
||||
shm_a = shared_memory.SharedMemory(name="DavidMaisonaveAxter_ChangeFileMonitor", create=False, size=4)
|
||||
shm_a = shared_memory.SharedMemory(name="DavidMaisonaveAxter_FileMonitor", create=False, size=4)
|
||||
except:
|
||||
pass
|
||||
logger.info("Could not open shared memory map. Change File Monitor must not be running.")
|
||||
@@ -1,7 +1,7 @@
|
||||
name: ChangeFileMonitor
|
||||
name: FileMonitor
|
||||
description: Monitors the Stash library folders, and updates Stash if any changes occurs in the Stash library paths.
|
||||
version: 0.1.0
|
||||
url: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/ChangeFileMonitor
|
||||
version: 0.2.0
|
||||
url: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/FileMonitor
|
||||
settings:
|
||||
recursiveDisabled:
|
||||
displayName: No Recursive
|
||||
@@ -17,7 +17,7 @@ settings:
|
||||
type: BOOLEAN
|
||||
zzdebugTracing:
|
||||
displayName: Debug Tracing
|
||||
description: (Default=false) [***For Advanced Users***] Enable debug tracing. When enabled, additional tracing logging is added to Stash\plugins\ChangeFileMonitor\changefilemonitor.log
|
||||
description: (Default=false) [***For Advanced Users***] Enable debug tracing. When enabled, additional tracing logging is added to Stash\plugins\FileMonitor\filemonitor.log
|
||||
type: BOOLEAN
|
||||
zzdryRun:
|
||||
displayName: Dry Run
|
||||
@@ -25,7 +25,7 @@ settings:
|
||||
type: BOOLEAN
|
||||
exec:
|
||||
- python
|
||||
- "{pluginDir}/changefilemonitor.py"
|
||||
- "{pluginDir}/filemonitor.py"
|
||||
interface: raw
|
||||
tasks:
|
||||
- name: Start Library Monitor
|
||||
@@ -1,11 +1,11 @@
|
||||
# Description: This is a Stash plugin which updates Stash if any changes occurs in the Stash library paths.
|
||||
# By David Maisonave (aka Axter) Jul-2024 (https://www.axter.com/)
|
||||
# Get the latest developers version from following link: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/ChangeFileMonitor
|
||||
# Get the latest developers version from following link: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/FileMonitor
|
||||
config = {
|
||||
# Enable to run metadata_generate (Generate Content) after metadata scan.
|
||||
"runGenerateContent": False,
|
||||
|
||||
# The following fields are ONLY used when running ChangeFileMonitor in script mode
|
||||
# The following fields are ONLY used when running FileMonitor in script mode
|
||||
"endpoint_Scheme" : "http", # Define endpoint to use when contacting the Stash server
|
||||
"endpoint_Host" : "0.0.0.0", # Define endpoint to use when contacting the Stash server
|
||||
"endpoint_Port" : 9999, # Define endpoint to use when contacting the Stash server
|
||||
@@ -1,14 +0,0 @@
|
||||
id: renamefile
|
||||
name: RenameFile
|
||||
metadata:
|
||||
description: Renames video (scene) file names when the user edits the [Title] field located in the scene [Edit] tab.
|
||||
version: 0.4.0
|
||||
date: "2024-07-26 08:00:00"
|
||||
requires: [pip install stashapp-tools, pip install pyYAML]
|
||||
source_repository: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/RenameFile
|
||||
files:
|
||||
- README.md
|
||||
- renamefile.yml
|
||||
- renamefile.py
|
||||
- renamefile_settings.py
|
||||
- requirements.txt
|
||||
Reference in New Issue
Block a user