- Updated FileMonitor plugin URL to Discourse link - Updated LocalVisage plugin URL to Discourse link - Updated PlexSync plugin URL to Discourse link - Updated PythonDepManager plugin URL to Discourse link - Updated PythonToolsInstaller plugin URL to Discourse link - Updated RenameFile plugin URL to Discourse link - Updated SFW Switch plugin URL to Discourse link - Updated SecondaryPerformerImage plugin URL to Discourse link - Updated StashRandomButton plugin URL to Discourse link - Updated TPDBMarkers plugin URL to Discourse link - Updated ThumbPreviews plugin URL to Discourse link - Updated VideoBanner plugin URL to Discourse link - Updated VideoScrollWheel plugin URL to Discourse link - Updated additionalFilesDeleter plugin URL to Discourse link - Updated audio-transcodes plugin URL to Discourse link - Updated bulkImageScrape plugin URL to Discourse link - Updated chooseYourAdventurePlayer plugin URL to Discourse link - Updated cjCardTweaks plugin URL to Discourse link - Updated comicInfoExtractor plugin URL to Discourse link - Updated defaultDataForPath plugin URL to Discourse link - Updated dupeMarker plugin URL to Discourse link - Updated e621_tagger plugin URL to Discourse link - Updated externalLinksEnhanced plugin URL to Discourse link - Updated filenameParser plugin URL to Discourse link - Updated funscriptMarkers plugin URL to Discourse link - Updated hotCards plugin URL to Discourse link - Updated imageGalleryNavigation plugin URL to Discourse link - Updated image_date_from_metadata plugin URL to Discourse link - Updated markerDeleteButton plugin URL to Discourse link - Updated markerTagToScene plugin URL to Discourse link - Updated miscTags plugin URL to Discourse link - Updated nfoSceneParser plugin URL to Discourse link - Updated pathParser plugin URL to Discourse link - Updated performerStashboxUrlToID plugin URL to Discourse link - Updated sceneCoverCropper plugin URL to Discourse link - Updated scenePageRememberStates plugin URL to Discourse link - Updated setPerformersFromTags plugin URL to Discourse link - Updated setSceneCoverFromFile plugin URL to Discourse link - Updated starIdentifier plugin URL to Discourse link - Updated stashAI plugin URL to Discourse link - Updated stashAppAndroidTvCompanion plugin URL to Discourse link - Updated stashNotes plugin URL to Discourse link - Updated stashNotifications plugin URL to Discourse link - Updated stashdb-performer-gallery plugin URL to Discourse link - Updated stats plugin URL to Discourse link - Updated tagCopyPaste plugin URL to Discourse link - Updated tagGalleriesFromImages plugin URL to Discourse link - Updated tagImagesWithPerfTags plugin URL to Discourse link - Updated tagScenesWithPerfTags plugin URL to Discourse link - Updated themeSwitch plugin URL to Discourse link - Updated timestampTrade plugin URL to Discourse link - Updated titleFromFilename plugin URL to Discourse link - Updated untagRedundantTags plugin URL to Discourse link - Updated videoChapterMarkers plugin URL to Discourse link - Updated BlackHole theme URL to Discourse link - Updated ColorPalette theme URL to Discourse link - Updated Minimal theme URL to Discourse link - Updated ModernDark theme URL to Discourse link - Updated NeonDark theme URL to Discourse link - Updated Night theme URL to Discourse link - Updated Plex theme URL to Discourse link - Updated PornHub theme URL to Discourse link - Updated Pulsar theme URL to Discourse link - Updated PulsarLight theme URL to Discourse link - Updated RoundedYellow theme URL to Discourse link - Updated FansDB Submission Helper userscript URL to Discourse link - Updated StashDB Submission Helper userscript URL to Discourse link
Path Default Tags
https://discourse.stashapp.cc/t/default-data-for-path/1373
Define default tags/performers/studio for Scenes, Images, and Galleries by file path. Big thanks to @WithoutPants - I based this entire script off of yours (markerTagToScene) and learned about Stash plugins during the process :)
Requirements
- Stash
Installation
- Download the whole folder 'defaultDataForPath' (defaultDataForPath.js, defaultDataForPath.yml)
- Place it in your plugins folder
- Reload plugins (Settings > Plugins)
- Default Data For Path (1.0) should appear.
Usage
- This plugin will execute on Tasks->Scan. Any new file added to Stash will be created with the specified data if configured.
Configuration
- Edit jsonData array. Refer to Examples.
Notes
- Remember to escape file paths!
- Note this script only works on NEWLY created Scenes/Images/Galleries. To run on existing content, the content will need to be removed from Stash and then rescanned.
- There is NO validation of tags/performers/studios being performed. They must exist in Stash and be spelled exactly the same to work. These values are not updated when they are updated in Stash. They will have to manually be configured. If there is a mismatch, an error will be logged and the affected file will not have any default data added. The Scan task will continue to execute however.
- If you misconfigure the script, the Task->Scan will complete and files will be created, but you can remove those files from Stash, fix the script, and try again.
- I recommend using VS Code but any text editor should do. I especially recommend an editor with collapse functionality as your config JSON grows.
- This requires a decent bit of manual effort and verbosity to configure, but only needs to be maintained after that.
- This may slow down your Task->Scan. This script is probably sloppily written, I was not sober when I wrote it, and haven't looked much at it since it works ¯\_(ツ)_/¯
Examples
Here is a simple config Object. It defines data for any Scene/Image/Gallery found within the paths listed (it includes all subfolders). Matching files will be assigned Studio 'Brazzers' and Tag 'Default_Data_For_Path_Tagged' assuming that Studio and Tag exist in Stash and are spelled this way.
'name' is optional and not used by the script. Feel free to include it for the purposes of organization.
'paths' is optional and defines what file paths the current Object config should apply to. If it is not included, then no files will be matched to this config, unless 'children' is used, in which case, those files in 'children' will be matched to this config. See next example.
'studio' is optional and defines a Studio to apply to file matches. The Studio must exist in Stash and be spelled the same.
'tags' is optional and defines Tags to apply to file matches. The Tags must exist in Stash and be spelled the same.
var jsonData = [
{
"name": "OPTIONAL NAME - NOT USED IN SCRIPT",
"paths": [
"C:\\Users\\UserName\\Desktop\\NOTPORN\\Brazzers",
"D:\\SecretStorage\\Porn\\Brazzers"
],
"studio": "Brazzers",
"tags": [
"Default_Data_For_Path_Tagged"
]
}
];
This config introduces a new concept. Note the 'Instagram Root' config object has no paths. It defines a studio and then children. This means all child config object of this will recieve the Studio 'Instagram' (it will overwrite any child config object studio definitions if different). You may also specify Performers and Tags in this way, those will be appended to child config objects definitions. See the 'Celebrities' config object is used in a similar way to add the tag 'PERFORMER - Celebrity' to its underlying children (which also recieve the Instagram studio as it is their ancestor). It saves you from having to add the tag to each config object seperately and allows for more logical config groupings to be created.
If you also add a 'paths' value to 'Instagram Root', then the data specified on 'Instagram Root' config object will be applied to files in that path as well. Data from children will not be carried over. For example, 'PornHub Root' applies studio PornHub to all files in "C:\Users\UserName\Desktop\Pornhub", and has children objects with more specific config. Instagram Root does not have such a paths specification. So a file in path "C:\Users\UserName\Desktop\Pornhub\SweetBunny" will have Studio PornHub added while a file in "C:\Users\UserName\Desktop\Instagram\Kylie Jenner" will not have Studio Instagram added.
So say a file is scanned that has file path "C:\Users\UserName\Desktop\Instagram\alexisfawx\video1.mp4". The data added will be:
Studio: Instagram - because the "Alexis Fawx" Config object is a descendant of the Instagram config object, and the scanned file matches "Alexis Fawx" Config object paths.
Tag: ORGANIZED - Unorganized - because the scanned file matches "Default Tag - Matches all scanned files" Config object paths.
Tag: PERFORMER - Pornstar - because the "Alexis Fawx" Config object is a child of the Pornstars config object, and the scanned file matches "Alexis Fawx" Config object paths.
Tag: PERFORMER - Caucasian - beacause the scanned file matches "Alexis Fawx" Config object paths.
Tag: PERFORMER - Fake Tits - beacause the scanned file matches "Alexis Fawx" Config object paths.
Performer: Alexis Fawx - beacause the scanned file matches "Alexis Fawx" Config object paths.
var jsonData = [
{
"name": "Default Tag - Matches all scanned files",
"paths": [
""
],
"tags": [
"ORGANIZED - Unorganized"
]
},
{
"name": "Instagram Root",
"studio": "Instagram",
"children": [
{
"name": "Celebrities",
"tags": [
"PERFORMER - Celebrity"
],
"children": [
{
"name": "Kim Kardashian",
"paths": [
"C:\\Users\\UserName\\Desktop\\Instagram\\kimkardashian"
],
"performers": [
"Kim Kardashian"
],
"tags": [
"PERFORMER - Armenian",
"PERFORMER - Big Ass"
]
},
{
"name": "Katy Perry",
"paths": [
"C:\\Users\\UserName\\Desktop\\Instagram\\katyperry"
],
"performers": [
"Katy Perry"
],
"tags": [
"PERFORMER - Caucasian,
"PERFORMER - Big Tits"
]
}
]
},
{
"name": "Pornstars",
"tags": [
"PERFORMER - Pornstar
],
"children": [
{
"name": "Alexis Fawx",
"paths": [
"C:\\Users\\UserName\\Desktop\\Instagram\\alexisfawx"
],
"performers": [
"Alexis Fawx"
],
"tags": [
"PERFORMER - Caucasian",
"PERFORMER - Fake Tits"
]
}
]
}
]
},
{
"name": "PornHub Root",
"paths": [
"C:\\Users\\UserName\\Desktop\\PornHub"
]
"studio": "PornHub",
"children": [
(etc...)
]
}
];