imgbrd-grabber icon indicating copy to clipboard operation
imgbrd-grabber copied to clipboard

Conditional filenaming not working for artist tags

Open Roshri opened this issue 1 year ago • 1 comments

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

  1. Add a new conditional filename with an artist tag as the condition, and use it as the folder name
  2. Search for any picture by that artist and download it
  3. Clicking on "Open" will open a folder name with the condition that was supposed to be changed
  4. Tried with danbooru and gelbooru sources

image

image

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

image

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

Roshri avatar Jul 29 '22 06:07 Roshri

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.

Bionus avatar Jul 30 '22 11:07 Bionus

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 avatar Dec 09 '22 03:12 flaccidbagel

@flaccidbagel so if I understand correctly, you have something like this: image

I'm not sure the conditionals support the meta:value syntax 🤔

Bionus avatar Dec 11 '22 15:12 Bionus

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)".

flaccidbagel avatar Dec 14 '22 01:12 flaccidbagel