PathParser cannot find rule?
I'm attempting to run this rule I created, but it doesn't seem to be working.
var rules = [
{
name: 'Performer/Performers - Title',
pattern: [
'be',
null,
/(.+) - (.+)/
],
fields: {
performers: '#1',
movie_title: '#2'
}
}
];
Here are the errors I receive:
25-06-18 17:15:13 Error
Plugin returned error: No rule matches id: 45
2025-06-18 17:15:13 Info
[Plugin / Path Parser] [PathParser] /be/Little Puck/Little Puck - Massive Milfy Mammaries Breast Growth.mp4
No matching rule!
'45' appears to be the id of this scene in my stash db.
What am I doing wrong?
I had to reset my password just to reply to this. The JS code is really basic as far as I can tell so there's probably 1 of 3 ways this isn't working.
- If you notice the path is listed as "/be/Little Puck/Little Puck..." which means the first rule needs to match a blank string. I literally just have to prefix all rules with a "null" match because I'm too lazy to try and remember how JS works and modify it.
- I believe the rules need to match the exact number of folders (including the first "null") or it will skip it.
- The rule needs to omit the base directory path listed in stashapp under Settings > Library > Library above the "Add directory" button.
In your case, I'd make a rule like:
//path is: X:/Files/be/Little Puck/Little Puck [not typing that here].mp4
//library path is X:/Files
{
name: 'Performer',
pattern: [
null,
"be",
null,
null,
],
fields: {
performers: '#3',
title: '#4"
},
},
Obviously you'd adjust it as needed because this would also match a file with the path like X:/Files/be/STUPID STUFF/IGNORE.wmv
Edit: ALSO completely unwritten anywhere in the code. The script will only run through 25 videos at a time max. This is because the query used to pull videos uses the default # and isn't paginated.
So to be able to actually make the script usable you need to make 1 small change. Find this:
// Run rules for scenes containing tag
function runRules(tag) {
var tagId = tryGetTag(tag);
if (tagId === null) {
throw "Tag " + tag + " does not exist";
}
var query =
"\
query FindScenes($sceneFilter: SceneFilterType) {\
findScenes(scene_filter: $sceneFilter) {\
scenes {\
id\
}\
}\
}";
And change the "findScenes(scene filter..." line to:
findScenes(scene_filter: $sceneFilter,filter:{per_page:-1}) {\
This will pull an unlimited number of scenes at once. There's warnings that you shouldn't do too many because it might be too heavy of a workload, but on my ~2015 laptop I was able to do hundreds to over a thousand without any real issues.
ALSO
... the performer, studio, tag needs to have already been created within stashapp or it will give another error. So you need to already have Little Puck (exact same spelling including spaces) or have an alias with Little Puck.
where do you define the rules? are you doing it in the JS file? if so, every time you update the plugin it will disappear