Is there a way to rename with the scene number?
like “Studio - Moviename (Scene 1)“
Or are there other options for groups?
edit
“next I’ll start working on some tokens for groups so that that metadata can also be used for patterns (like movie name folders, scene numbering in filenames)“
Work on this was actually completed yesterday I just forgot to publish it! Try upgrading to version 0.10.0 and there should be both {group} and {group_idx} tokens to do exactly what you want
The {group} and {group_idx} tokens work perfectly!
One possible bug - I have performers set to 1 Favorites first and 2 Highest Rated both on, but I have a 1.4 rated performer starting with F being listed above an 8.9 performer who starts with G.
And as mentioned over in Discord, it would be awesome if orphaned folders were automatically removed but I understand it might not be possible.
I am unable to reproduce this locally, can you give me some more details? Are any of the performers favorited, is this for a scene, gallery or image, which version of the plugin are you running?
And for the empty folder removal, that’s not something that’s easily done through the Stash API right now so Librarian can’t support it. But there’s a PR #7126 that is deprecating the Clean task and introducing new tools for marking files/folders as missing, so I’m keeping an eye on that
Ahh I see what’s happening, it’s a just preview issue. Here’s what I have:
Alice - Not a favorite - 1.9 rating
Sara - Not a favorite - 6.9 rating
Favorite is set to highest priority, then rating and finally a-z so it should sort to: /Performers/S/Sara/Title - Sara, Alice 1080p.mov
If I sort via the scene details, it previews and sorts correctly. Woo!
However if I’m looking at the either performer page and use the Librarian preview it previews with Alice, Sara , even though it will actually sort to Sara, Alice when the rename button is pressed.
Totally get it about the orphaned folders - I’ll just run a script to get rid of them for now.
Thanks for the details, I was able to track this down and fix it
Like you said it only ever affected scene previews because they share Stash’s own queries, renames were always going to be correct. In version 0.10.1 I just run a second query and the previews should be in full agreement across all of Stash’s pages
Suggestion: modifier |field=X that would evaluate to the custom field X on the entity (performer, studio, group) if it is set or the default name of the entity otherwise. The usecases:
Studios shift ownership, e.g. I prefer to keep the content from norestfortheass.com in the original folder rather than "Anal Vids/No Rest For The Ass”.
A performer may be better known to me by one of the aliases other than the default on StashDB
Not sure if this is harder to lookup and if the logic is too much of a rabbit hole due to gender, but could it be useful to have a rule option to filter by performer rating?
ie.
Match if ANY
Performer Rating - any FEMALE lower than 8
Match if ALL
Performer Rating - all FEMALE rating is greater than 8
Studio - is any of - Vivid etc
Match if ANY
Performer Rating - all MALE rating is greater than 8
Use case: If a scene has any highly rated performer sort by Performer, or if a scene has no highly rated performers sort by studio etc.
I have added support for custom fields for both scenes/galleries/images and their associated performers, written like {@Custom Field Name}. They are case sensitive and can be combined with all of the normal token modifiers. They can be used as conditionals as well.
Note that since custom fields do not have a schema I had to be pretty generous with how I implemented comparisons, so I’d love to hear feedback if you run into any edge cases!
I also added support for conditions that involve performer ratings and favorite status, but I didn’t want to complicate it so much that it also accounts for gender: hopefully you can solve your desired usecase with the combination of these new conditions and token modifiers such as {matched_performers|gender=female} for example
Totally get it on the keeping it simple. Gender doesn’t matter for me personally, but I am running into an ANY/ALL situation where it is only comparing for ALL. Is this too complicated?
Two performers on scene:
Performer A - 7.8
Performer B - 3.4
This is getting caught in my rule for Low Rated Performers: Performer Rating - is rated - 0-5
Instead of is rated maybe having all are rated and any are rated? Or simply add is not rated?
I guess I could have the studio sort be the default and set the rule for the top rated performers, but in my brain it makes more sense to filter out the Low Performers before running the other rules since the other rules are tied to sorting inside a Performer folder.
Also, there goes my weekend cause this plugin is so good I’m redoing everything.
Can someone give me a quick tutorial in the filename pattern options? I do some simple things like moving all scenes with a particular performer or studio into a specific folder.
My filename pattern is {studio}.{date}.{title}.{resolution}
If the scene doesn’t have an assigned date or title, how would I insure that the filename is unique so it can be moved into a performer or studio folder?
@Maista Excellent work with this plugin, it certainly makes a lot of background leg work much quicker.
The only problem I have encountered is that some performers folders can get merged with others under certain folder patterns due to them using the same name. For example setting Librarian to arrange folders by performer name first.
Within Stash disambiguation handles this problem, and previously I would just manually add this information into folder names as well. However, I don’t think it currently possible within Librarian (please correct me if I’m wrong), perhaps this is something resolvable already that I haven’t found or something that may warrant a fix.
Just getting started using this and moving my configs from renamerOnUpdate, but my initial impression is that this is the GOAT of Stash plugins and should be recommended to any one who wants to rename or move their files. I LOVE the ability to preview renames graphically and that the plugin can both rename on demand and automatically after updates. I’ll see if there’s anything to nitpick as I use it more, but I’m very impressed so far to say the least!
Thank you all for the kind words, and special thanks to everyone who’s trying out Librarian and reporting back with usecases that I hadn’t run into! My Stash is a rather small and mainstream 10k scenes so I’m sure there are plenty of things I can add to improve the plugin for others
I have added the ability to use disambiguation in performer tokens in version 0.11.1, so {performers|limit=1|disambiguate} for example should give you unique folder names
I was using renamerOnUpdate and renameGalleryOnUpdate up until now. Librarian is very nice! I tend to keep my data organized in scene style format, so this is what I ended up using for name formatting, along with the replace spaces with periods option:
I think if anything, it might be nice to have a {date_year} option that only uses two digits, right now I’m using regex to get only the last two and that feels a bit heavy handed.
I had kind of a split between performer and site hierarchies in my directory structure, so this was nice to just immediately shift everything to one structure. I was also able to move across library paths which was cool!
Version 0.11.2 should be able to express these! I changed the wording so it’s “every performer” or “any performer” when you’re filtering by favorite/ratings so it should read better as well.
Thank you for adding the disambiguate function so quickly it works perfectly, interestingly my collection is smaller than 10k (though not very mainstream) which probably helped, that and my OCD around folder organisation, which brings me to:
I’ve been trying to organise my Librarian settings in such a way that I can control on a as needed case by case basis which performer in a scene with multiple female performers will be used for folder naming when the desired performer is not selected using the current sort functions. For example in my manual organisation I would assign such scenes into a individual performer folder based on which performer is the submissive or receiver.
My question is there a current mechanism to be able to assign which specific performer to use in these cases (beyond removing the second performer). I have played with the current options, and so far have not found a way to make it work fully. I got part way with isolating the scenes using a rule based on around a custom-field attached to the each desired performer per scene but could not manage to find a way from there to get Librarian to use that performer to create the desired folder structure.
If its not currently possible just let me know, I don’t want to create more work for you for if such a feature is too complex, niche or beyond what the scope of what librarian is for.
Fun aside: I had never used Regex before and spent about 3 hours yesterday reading documentation to get the gist of it to create self sorting A-Z folders. So thank you for inadvertently getting me to learn something new.
Love the |disambiguate option, but can I suggest it it only throw up an error if its not in the first {performer} nest in a path?
For instance I have: /{performers|disambiguate|limit=1}>/<[{studio_root}] - {performers|limit=1}>/ and that still flags an error even though the disambiguation happens first which solves the issue, and the subfolders don’t need to be disambiguated.
(Yes I know I have redundant performer names in the path, it just helps if I’m doing a global search for [studio] in the system I can see all the performers that have scene folders for that studio.)
Also it would be nice to split the lines of the warning so it doesn’t push everything else off screen.
This is exactly what the {matched_performers} token does, it gives you the performer that matched that particular rule So if I’m understanding your use case correctly you’d use a condition like “Performer (any performer) has a custom field ‘Role’ that is ‘submissive’” (or however you’re tracking this) and then you’d use {matched_performers|limit=1} in your folder pattern (drop the limit if your rule can only match one performer) to use that exact performer for the folder name
If you instead have this information attached to the scene, like the field is called “Submissive” and it contains the performer name, then you could use it directly in the folder pattern like {@Submissive}: this is more fragile, of course, since Stash has no idea this custom field represents a performer and thus cannot update it when/if the performer name changes, but that’s a limitation of custom fields that I don’t really want to work around
Happy to hear you’ve learned some regular expressions! They’re a powerful tool and show up in all sorts of places
I had in fact not considered more complex patterns like this I’ve written some new logic to hopefully handle this better, please update to version 0.11.3 and see if that’s better