Bionus / imgbrd-grabber

Very customizable imageboard/booru downloader with powerful filenaming features.
https://www.bionus.org/imgbrd-grabber/
Apache License 2.0
2.58k stars 220 forks source link

Is it possible to sort the tags according to the tagCount for sorting by "popularity"? #3198

Open Cheraps opened 5 months ago

Cheraps commented 5 months ago

Hello, I would like to know if there is a way to sort tags of a type/category based on TagCount?

For example, let's take an image that contains many different characters:

A_character (180) B_character (500) G_character (830) E_character (8000) L_character (10000) X_character (5500)

By default, characters are sorted in alphabetical order:

% character:sort=alphabetical % =

A_character (180)+B_character (500)+G_character (830)+E_character (8000)+L_character (10000)+X_character (5500)

I would like to be able to sort them, in some way, by popularity, thus displaying in the first position and decreasing, the tags with the largest tagCount.

_% character:sort=countdesc % =

L_character (10000)+E_character (8000)+X_character (5500)+G_character (830)+B_character (500)+A_character (180)

The objective of doing this is in the case where there are many "copyright" / "character" / "general..." to say: "I only want in the name of my file, only the copyright and/or the 3 most important characters, sorted in descending order (we can also imagine wanting to reverse it by sorting the tags with the smallest TagCount towards the largest).

C_copyright (99999999) - L_character (10000), E_character (8000), X_character (5500) - %md5%.jpg

This way, my files will be grouped around the most important copyrights / characters / tags without having files with names that are too long because they include too many secondary characters. Secondary characters that I don't want to "ignore" or "blacklist" because they may also be needed on other files.

I've dissected the docs, searched all the questions and tested many things but I haven't found how to do it.

Thank you in advance for your response and congratulations for all your work done so far! ;)