Bionus / imgbrd-grabber

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

Tag Grouping #2408

Open yami-no-tusbas opened 3 years ago

yami-no-tusbas commented 3 years ago

Ok, I know grabber as a "use shortest if possible" feature, and it work fine for some case.

But I'm thinking of something like a form , where we can add a "group tag" and what is in the group, then Grabber on saving would check if one tag is part of a group, and if so, replace it by something the user define. And since an exemple is worth a tousand word :

Group title : Pokemon Matches : pokemon_(anime),pokemon_(classic_anime),pokemon_(creature),pokemon_(game),pokemon_4koma_gag_battle,pokemon_adventures,pokemon_battle,pokemon_battle_revolution,pokemon_bdsp,pokemon_breeder_(pokemon),pokemon_bw,pokemon_bw_(anime),pokemon_bw2,pokemon_cafe_mix,pokemon_card,pokemon_center,pokemon_colosseum,pokemon_conquest,pokemon_dp_(manga),pokemon_dp_legend,pokemon_dp070,pokemon_dp117,pokemon_dppt,pokemon_dppt_(anime),pokemon_duel,pokemon_ears,pokemon_egg,pokemon_emerald,pokemon_ep018,pokemon_ep042,pokemon_ep048,pokemon_frlg,pokemon_game,pokemon_generations,pokemon_go,pokemon_gsc,pokemon_gsc_beta,pokemon_gym,pokemon_hgss,pokemon_lgpe,pokemon_m01,pokemon_m02,pokemon_m03,pokemon_m04,pokemon_m05,pokemon_m06,pokemon_m07,pokemon_m08,pokemon_m09,pokemon_m10,pokemon_m11,pokemon_m12,pokemon_m13,pokemon_m19,pokemon_m20,pokemon_m21,pokemon_m23,pokemon_mart,pokemon_masters,pokemon_masters_ex,pokemon_move,pokemon_mystery_dungeon,pokemon_mystery_dungeon_explorers_of_sky,pokemon_on_arm,pokemon_on_back,pokemon_on_head,pokemon_on_lap,pokemon_on_leg,pokemon_on_shoulder,pokemon_oras,pokemon_origins,pokemon_performer,pokemon_platinum,pokemon_pocket_monsters,pokemon_ranger,pokemon_ranger_(game),pokemon_ranger_(pokemon),pokemon_ranger_1,pokemon_ranger_2,pokemon_ranger_3,pokemon_ranger_traces_of_light,pokemon_ranger_uniform,pokemon_ranger_vatonage,pokemon_reburst,pokemon_rgby,pokemon_rgby_(prototype),pokemon_rgby_(style),pokemon_rgby_beta,pokemon_rse,pokemon_rse_(anime),pokemon_sm,pokemon_sm_(anime),pokemon_sm042,pokemon_sm049,pokemon_sm113,pokemon_snap,pokemon_snap_xxx,pokemon_special,pokemon_special_anime,pokemon_stadium,pokemon_swsh,pokemon_swsh_(anime),pokemon_swsh043,pokemon_tail,pokemon_tcg,pokemon_tcg_gb,pokemon_tower_ghost,pokemon_trainer,pokemon_ultra_sm,pokemon_unite,pokemon_usum,pokemon_xd,pokemon_xd_whirlwind_of_darkness,pokemon_xy,pokemon_xy_(anime),pokemon-amie,pokemonmastersex Replace by : Pokemon_(series)

Yeah yeah, that's a lot of pokemon tags to replace, or ignore :-)

Bionus commented 3 years ago

There's currently nothing built-in to achieve this very result. Should I mark this ticket as a suggestion or is it a question?

However, you can manage to group tags with custom tokens then using a filename conditional, but they'll will still appear in %all% and similar (they won't get "replaced"). For example something like <%pokemon%?pokemon> will show "pokemon" if any tag present in the "pokemon" custom token is present in the image's tags.

yami-no-tusbas commented 3 years ago

Sry for the late response, I kinda solved this using "ignore" function. Conditional need to be in the filename so can't be used on the fly with a filename like : "%websitename%\%search%\%copyright%\%character%\%artist% - %id% - %rating% - %md5%.%ext%"

This is why i was thinking about something like a two entry table one row would be "replacement", other : "what to replace", then on the moment of saving the app could check the replacement table, and replace, then if duplicate found, ignore them.

For exemple let say we got a crazy image with multiples copyrights : gelbooru\creatures_(company) game_freak nintendo pokemon_(anime) pokemon_swsh_(anime) pokemon_(classic_anime)\Ash Ketchum\...

The table of remplacement would be the long string stated before.

output would be : gelbooru\Ash Ketchum\creatures_(company) game_freak nintendo pokemon\...

and if nintendo, gamefreak and creatures(company) where in the what to replace column too, that would be : gelbooru\pokemon\Ash Ketchum\...

So user can input whatever they want, not only thing with similar name (use shortest if possible is here for that). But maybe it's too much work for the app to replace on each save, it's basicly custom token, but more "global" I think. And this don't have to care about the tag type. Could be used for artist aliases or difference in name of artist from board to board and so on. Kinda search and replace, but with multiples input for one replace.

Bionus commented 3 years ago

I see. Kinda similar to "implications" and "aliases" for tags on multiple boards. But Grabber-side.

I guess it could be done. The issue will be the performance and UX, I'll have a look.

yami-no-tusbas commented 3 weeks ago

Hey, I was wondering if this Issue has advanced ? It's been a while since, and while the "ignore" function help I just encountered a case where this would have help.

I got a very long game name : okasare_yuusha_ii_yuusha_na_no_ni_chinchin_wo_pikupiku_sarete_bakari_no_boku while downloading a bunch of image. Guess What, some character in that copyright have the entire name in parenthesis... So it was impossible to save the image. And ignoring the tag was not possible too... Since it's the main copyright of the game. And I took a look into the "conditional filename" and it's not useful here, since it need a "filename" and for that download my filename was fairly complex using multiple conditional already to organize the files.

So a search and replace here would have been nice. I was wondering about something like the "ignore" list but with two entries separated by a space. Like : okasare_yuusha_ii_yuusha_na_no_ni_chinchin_wo_pikupiku_sarete_bakari_no_boku SPACE oka_yusha The space would indicate I want to replace instead of ignoring. Since I would only use this for very long tag It should be rare. But maybe this would impact performance too much.

Oh and on a side note, I would love those conditionals filenames to work on batches too, but just altering the concerned part of the string instead of having me put a whole new output folder or filename.