imgbrd-grabber
imgbrd-grabber copied to clipboard
Conditional filenaming not working for artist tags
Bug description
Some artists go by multiple pen-names so I like to group them all in a single folder by a name I recognize the most. So I set up some conditional filenaming rules and some time ago it stopped working as intended
Steps to reproduce
- Add a new conditional filename with an artist tag as the condition, and use it as the folder name
- Search for any picture by that artist and download it
- Clicking on "Open" will open a folder name with the condition that was supposed to be changed
- Tried with danbooru and gelbooru sources
Tried to make it work both of these ways and it still gets downloaded to a "kuppipi ramutarou" folder
Expected behavior
The folder should be named as detailed in the conditional filename prompt
- OS: Windows 10
- Grabber version: 7.9.1
EDIT: Found something that could be helpful. The problem appeared on precure images, which have another conditional filename set, like this
So I guess there's a conflict between the rules, is there a way to set priority?
EDIT 2: Tried moving the precure condition to the last place of the list and now it works as intended. Having the option to move the conditions with a button (to send them to the bottom, for example) would be great for these kind of situations where a new condition conflicts with a previous one. I guess this now became a feature request? Sorry for the trouble
In your case, I believe the main issue was actually that filenames were not all being evaluated. Since in one you're overriding the filename, and in another the folder, they should both be taken into account. I pushed a fix so that it works fine.
Now, filenames will work just like folder: use the last matching filename (so conditionals at the bottom have "priority" over ones at the top). This was actually already the case for folders, but for filenames we were stopping at the first one.
I've begun to notice some interesting behavior with this as well. For example trying to create a condition for a user tagged "Wet_Cheetos" with an output folder of "Wet Cheetos (FullCounter)" results in two separate scenarios.
If the condition is simply "Wet_Cheetos", the resulting save folder is just Wet Cheetos. If I use the condition/tag of "user:Wet_Cheetos" to only focus on their uploads, the folder is then named "user Wet Cheetos". I'm not sure what it is, but it seems there's something about the tag that's causing it to simply skip over the folder assignment portion.
So far, no permutation of quotations or parentheses in the name has fixed the issue for me. Yet I can do the same with other artists just fine, though I've noticed the others I'm trying this with don't use an underscore in their tags or usernames.
@flaccidbagel so if I understand correctly, you have something like this:
I'm not sure the conditionals support the meta:value
syntax 🤔
That pretty much sums it up, though the user:Wet_Cheetos
tag also points to the same folder path, "D:\out\Wet Cheetos (FullCounter)". I tried each one separately to see if I could get them to point to the preferred folder. I figured if the meta:value
syntax doesn't work, I could work around it by just searching for the tag itself, but then there's the strange behavior with the top entry, as it still seems to ignore the folder path, stopping at "D:\out\Wet Cheetos" rather than using "D:\out\Wet Cheetos (FullCounter)".