Changes via prettier

This commit is contained in:
David Maisonave
2024-07-28 05:38:09 -04:00
parent 41167b019f
commit c574721989
5 changed files with 35 additions and 28 deletions

View File

@@ -1,2 +1,3 @@
# Axter-Stash # Axter-Stash
Plugins for Stash Plugins for Stash

View File

@@ -1,19 +1,22 @@
# ChangeFileMonitor: Ver 0.1.0 (By David Maisonave) # 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. ChangeFileMonitor is a [Stash](https://github.com/stashapp/stash) plugin which updates Stash if any changes occurs in the Stash library paths.
### Using ChangeFileMonitor ### Using ChangeFileMonitor
- To start monitoring file changes, go to **Stash->Settings->Task->[Plugin Tasks]->ChangeFileMonitor**, and click on the [Start Library Monitor] button. - To start monitoring file changes, go to **Stash->Settings->Task->[Plugin Tasks]->ChangeFileMonitor**, and click on the [Start Library Monitor] button.
- ![ChangeFileMonitor_Task](https://github.com/user-attachments/assets/f275a70f-8e86-42a4-b2c1-98b3f4935334) - ![ChangeFileMonitor_Task](https://github.com/user-attachments/assets/f275a70f-8e86-42a4-b2c1-98b3f4935334)
- To stop this task, go to **Stash->Settings->Task->[Task Queue]**, and click on the **[x]**. - To stop this task, go to **Stash->Settings->Task->[Task Queue]**, and click on the **[x]**.
- ![Kill_ChangeFileMonitor_Task](https://github.com/user-attachments/assets/a3f4abca-f3a2-49fa-9db5-e0c733e0aeb1) - ![Kill_ChangeFileMonitor_Task](https://github.com/user-attachments/assets/a3f4abca-f3a2-49fa-9db5-e0c733e0aeb1)
### Requirements ### Requirements
`pip install stashapp-tools` `pip install stashapp-tools`
`pip install pyYAML` `pip install pyYAML`
`pip install watchdog` `pip install watchdog`
### Installation ### Installation
- Follow **Requirements** instructions. - Follow **Requirements** instructions.
- In the stash plugin directory (C:\Users\MyUserName\.stash\plugins), create a folder named **ChangeFileMonitor**. - 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**). - Copy all the plugin files to this folder.(**C:\Users\MyUserName\\.stash\plugins\ChangeFileMonitor**).
@@ -22,6 +25,5 @@ ChangeFileMonitor is a [Stash](https://github.com/stashapp/stash) plugin which u
That's it!!! That's it!!!
### Options ### Options
- All options are accessible in the GUI via Settings->Plugins->Plugins->[ChangeFileMonitor]. - All options are accessible in the GUI via Settings->Plugins->Plugins->[ChangeFileMonitor].

View File

@@ -1,5 +1,5 @@
name: ChangeFileMonitor name: ChangeFileMonitor
description: Monitors the Stash library folders, and updates Stash if any changes occurs in the Stash library paths. description: Monitors the Stash library folders, and updates Stash if any changes occurs in the Stash library paths.
version: 0.1.0 version: 0.1.0
url: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/ChangeFileMonitor url: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/ChangeFileMonitor
settings: settings:
@@ -14,7 +14,7 @@ settings:
scanModified: scanModified:
displayName: Scan Modifications displayName: Scan Modifications
description: Enable to monitor changes in file system for modification flag. This option is NOT needed for Windows, because on Windows changes are triggered via CREATE, DELETE, and MOVE flags. Other OS may differ. description: Enable to monitor changes in file system for modification flag. This option is NOT needed for Windows, because on Windows changes are triggered via CREATE, DELETE, and MOVE flags. Other OS may differ.
type: BOOLEAN type: BOOLEAN
zgraphqlEndpoint: zgraphqlEndpoint:
displayName: GraphQL Endpoint displayName: GraphQL Endpoint
description: (Default=http://localhost:9999/graphql). Update with your endpoint, or leave blank to use default. description: (Default=http://localhost:9999/graphql). Update with your endpoint, or leave blank to use default.
@@ -22,11 +22,11 @@ settings:
zzdebugTracing: zzdebugTracing:
displayName: Debug Tracing 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\ChangeFileMonitor\changefilemonitor.log
type: BOOLEAN type: BOOLEAN
zzdryRun: zzdryRun:
displayName: Dry Run displayName: Dry Run
description: Enable to run script in [Dry Run] mode. In this mode, Stash does NOT call meta_scan, and only logs the action it would have taken. description: Enable to run script in [Dry Run] mode. In this mode, Stash does NOT call meta_scan, and only logs the action it would have taken.
type: BOOLEAN type: BOOLEAN
exec: exec:
- python - python
- "{pluginDir}/changefilemonitor.py" - "{pluginDir}/changefilemonitor.py"
@@ -35,4 +35,4 @@ tasks:
- name: Start Library Monitor - name: Start Library Monitor
description: Monitors paths in Stash library for media file changes, and updates Stash. description: Monitors paths in Stash library for media file changes, and updates Stash.
defaultArgs: defaultArgs:
mode: start_library_monitor mode: start_library_monitor

View File

@@ -1,5 +1,7 @@
# RenameFile: Ver 0.4.0 (By David Maisonave) # RenameFile: Ver 0.4.0 (By David Maisonave)
RenameFile is a [Stash](https://github.com/stashapp/stash) plugin which performs the following tasks. RenameFile is a [Stash](https://github.com/stashapp/stash) plugin which performs the following tasks.
- **Rename Scene File Name** (On-The-Fly) - **Rename Scene File Name** (On-The-Fly)
- **Append tag names** to file name - **Append tag names** to file name
- **Append Performer names** to file name - **Append Performer names** to file name
@@ -10,8 +12,9 @@ In addition, the plugin optionally also appends tags and performers to the file
Note: This script is **largely** based on the [Renamer](https://github.com/Serechops/Serechops-Stash/tree/main/plugins/Renamer) script. Note: This script is **largely** based on the [Renamer](https://github.com/Serechops/Serechops-Stash/tree/main/plugins/Renamer) script.
### Using RenameFile ### Using RenameFile
- Open a scene (via Stash), and click on the [**Edit**] tab. Populate the [**Title**] field with the desired file name.
- Note: Do **NOT** include the file folder name and do **NOT** include file extension. - Open a scene (via Stash), and click on the [**Edit**] tab. Populate the [**Title**] field with the desired file name.
- Note: Do **NOT** include the file folder name and do **NOT** include file extension.
- After populating the Title field, click the save button. - After populating the Title field, click the save button.
- After a few seconds, the file will get renamed and the screen will get updated with the new file name. - After a few seconds, the file will get renamed and the screen will get updated with the new file name.
- The append tags and perfomers option is disable by default. To enable these options go to the Settings->Plugins->Plugins->[RenameFile] field options, and enable the associated field. - The append tags and perfomers option is disable by default. To enable these options go to the Settings->Plugins->Plugins->[RenameFile] field options, and enable the associated field.
@@ -25,27 +28,28 @@ Note: This script is **largely** based on the [Renamer](https://github.com/Serec
- Define key fields to use to format the file name. This is a comma seperated list, and the list should be in the desired format order. (Default=title,performers,studio,tags) - Define key fields to use to format the file name. This is a comma seperated list, and the list should be in the desired format order. (Default=title,performers,studio,tags)
- For example, if the user wants the performers name before the title, set the performers name first. - For example, if the user wants the performers name before the title, set the performers name first.
- Example:"performers,title,tags". - Example:"performers,title,tags".
- This is an example of user adding height:"title,performers,tags,height" - This is an example of user adding height:"title,performers,tags,height"
- Here's an example using all of the supported fields: "title,performers,tags,studio,galleries,resolution,width,height,video_codec,frame_rate,date". - Here's an example using all of the supported fields: "title,performers,tags,studio,galleries,resolution,width,height,video_codec,frame_rate,date".
- The **resolution** field equals width + height. - The **resolution** field equals width + height.
- The date field is **not** populated by default unless the user explicitly adds the date value to a scene. - The date field is **not** populated by default unless the user explicitly adds the date value to a scene.
- If **[Key Fields]** is empty, the default value is used. (Default=title,performers,studio,tags) - If **[Key Fields]** is empty, the default value is used. (Default=title,performers,studio,tags)
- There are additional options in renamefile_settings.py, but these options should only be changed by advanced users, and any changes should be tested first with the [Dry-Run] option enabled. - There are additional options in renamefile_settings.py, but these options should only be changed by advanced users, and any changes should be tested first with the [Dry-Run] option enabled.
**Note:** On Windows 10/11, the file can not be renamed while it's playing. It will result in following error: **Note:** On Windows 10/11, the file can not be renamed while it's playing. It will result in following error:
` `Error: [WinError 32] The process cannot access the file because it is being used by another process`
Error: [WinError 32] The process cannot access the file because it is being used by another process
`
To avoid this error, refresh the URL before changing the Title field. To avoid this error, refresh the URL before changing the Title field.
### Requirements ### Requirements
pip install -r requirements.txt pip install -r requirements.txt
- Or manually install each requirement: - Or manually install each requirement:
- `pip install stashapp-tools` - `pip install stashapp-tools`
- `pip install pyYAML` - `pip install pyYAML`
- `pip install requests` - `pip install requests`
### Installation ### Installation
- Follow **Requirements** instructions. - Follow **Requirements** instructions.
- Create a folder named **RenameFile**, in the stash plugin directory (C:\Users\MyUserName\.stash\plugins). - Create a folder named **RenameFile**, in the stash plugin directory (C:\Users\MyUserName\.stash\plugins).
- Download the latest version from the following link: [RenameFile](https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/RenameFile), and copy the plugin files to folder.(**C:\Users\MyUserName\\.stash\plugins\RenameFile**). - Download the latest version from the following link: [RenameFile](https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/RenameFile), and copy the plugin files to folder.(**C:\Users\MyUserName\\.stash\plugins\RenameFile**).
@@ -54,6 +58,6 @@ pip install -r requirements.txt
That's it!!! That's it!!!
### Options ### Options
- Main options are accessible in the GUI via Settings->Plugins->Plugins->[RenameFile]. - Main options are accessible in the GUI via Settings->Plugins->Plugins->[RenameFile].
- Advanced options are avialable in the **renamefile_settings.py** file. After making changes, go to http://localhost:9999/settings?tab=plugins, and click [Reload Plugins]. - Advanced options are avialable in the **renamefile_settings.py** file. After making changes, go to http://localhost:9999/settings?tab=plugins, and click [Reload Plugins].

View File

@@ -1,28 +1,28 @@
name: RenameFile name: RenameFile
description: Renames video (scene) file names when the user edits the [Title] field located in the scene [Edit] tab. description: Renames video (scene) file names when the user edits the [Title] field located in the scene [Edit] tab.
version: 0.4.0 version: 0.4.0
url: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/RenameFile url: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/RenameFile
settings: settings:
performerAppend: performerAppend:
displayName: Append Performers displayName: Append Performers
description: Enable to append performers name to file name when renaming a file. Requires performers to be included in [Key Fields] list, which by default it is included. description: Enable to append performers name to file name when renaming a file. Requires performers to be included in [Key Fields] list, which by default it is included.
type: BOOLEAN type: BOOLEAN
studioAppend: studioAppend:
displayName: Append Studio displayName: Append Studio
description: Enable to append studio name to file name when renaming a file. Requires studio to be included in [Key Fields] list, which by default it is included. description: Enable to append studio name to file name when renaming a file. Requires studio to be included in [Key Fields] list, which by default it is included.
type: BOOLEAN type: BOOLEAN
tagAppend: tagAppend:
displayName: Append Tags displayName: Append Tags
description: Enable to append tag names to file name when renaming a file. Requires tags to be included in [Key Fields] list, which by default it is included. description: Enable to append tag names to file name when renaming a file. Requires tags to be included in [Key Fields] list, which by default it is included.
type: BOOLEAN type: BOOLEAN
z_keyFIeldsIncludeInFileName: # Prefixing z_ to variable names so that the GUI will place these fields after above fields (alphabatically listed) z_keyFIeldsIncludeInFileName: # Prefixing z_ to variable names so that the GUI will place these fields after above fields (alphabatically listed)
displayName: Include Existing Key Field displayName: Include Existing Key Field
description: Enable to append performer, tags, studios, & galleries even if name already exists in the original file name. description: Enable to append performer, tags, studios, & galleries even if name already exists in the original file name.
type: BOOLEAN type: BOOLEAN
zafileRenameViaMove: zafileRenameViaMove:
displayName: Rename Using Move displayName: Rename Using Move
description: Enable to have file moved when renaming file. description: Enable to have file moved when renaming file.
type: BOOLEAN type: BOOLEAN
zfieldKeyList: zfieldKeyList:
displayName: Key Fields displayName: Key Fields
description: '(Default=title,performers,studio,tags) Define key fields to use to format the file name. This is a comma seperated list, and the list should be in the desired format order. For example, if the user wants the performers name before the title, set the performers name first. Example:"performers,title,tags". This is an example of user adding height:"title,performers,tags,height" Here''s an example using all of the supported fields: "title,performers,tags,studio,galleries,resolution,width,height,video_codec,frame_rate,date".' description: '(Default=title,performers,studio,tags) Define key fields to use to format the file name. This is a comma seperated list, and the list should be in the desired format order. For example, if the user wants the performers name before the title, set the performers name first. Example:"performers,title,tags". This is an example of user adding height:"title,performers,tags,height" Here''s an example using all of the supported fields: "title,performers,tags,studio,galleries,resolution,width,height,video_codec,frame_rate,date".'
@@ -50,11 +50,11 @@ settings:
zzdebugTracing: zzdebugTracing:
displayName: Debug Tracing displayName: Debug Tracing
description: (Default=false) [***For Advanced Users***] Enable debug tracing. When enabled, additional tracing logging is added to Stash\plugins\RenameFile\renamefile.log description: (Default=false) [***For Advanced Users***] Enable debug tracing. When enabled, additional tracing logging is added to Stash\plugins\RenameFile\renamefile.log
type: BOOLEAN type: BOOLEAN
zzdryRun: zzdryRun:
displayName: Dry Run displayName: Dry Run
description: Enable to run script in [Dry Run] mode. In dry run mode, files are NOT renamed, and only logging is performed. Use the logging to determine if rename will occur as expected. This should always be enabled on the first run after renamefile_settings.py has been modified. description: Enable to run script in [Dry Run] mode. In dry run mode, files are NOT renamed, and only logging is performed. Use the logging to determine if rename will occur as expected. This should always be enabled on the first run after renamefile_settings.py has been modified.
type: BOOLEAN type: BOOLEAN
exec: exec:
- python - python
- "{pluginDir}/renamefile.py" - "{pluginDir}/renamefile.py"
@@ -68,4 +68,4 @@ tasks:
- name: Rename Last Scene - name: Rename Last Scene
description: Renames file of last updated scene. description: Renames file of last updated scene.
defaultArgs: defaultArgs:
mode: rename_files_task mode: rename_files_task