rr- / szurubooru

Image board engine, Danbooru-style.
GNU General Public License v3.0
724 stars 182 forks source link

Feature Request: Implication tagging #556

Open myalow opened 1 year ago

myalow commented 1 year ago

I've come across a few issues now (#189,#208,#334,#337) That seem to get a general idea across for what I have in mind, but all of those issues seem to be either shot down or just dead.

Basically, I would like to see implications treated in a more 'parent-child' hierarchy. That is, if a post is tagged say, super_mario, and nintendo is an implication for super_mario, all images tagged super_mario, both going forward and retroactively, should be tagged nintendo. on #189, I see a couple valid arguments against this;

But I'm against adding the tags automatically. Say you make a mistake and everything just got tagged with capcom rather than nintendo. How do you undo that?

The suggestion I'm making is to update these implications automatically, and do the same if an implication is removed from a tag (ie. I get rid of the metroid_(series) implication for ridley, then the nintendo tag should also get removed from any image that is tagged with ridley).

This is insane, how do you tell if something was tagged by hand or by a tag implication?

What I would consider a solution to both of these issues is a form of symbolic tagging. Rather than any super_mario post actually being hard-tagged with nintendo, any post that returns super_mario should show in search results for nintendo and show nintendo in the tag list. I'd imagine you could have it work like so:

if search implications >0:
  return search + implications
if taglist includes `super_mario` &! `nintendo`:
  include `nintendo`

In both examples, Szurubooru would check for if a tag has any relations, and display the related tag in either search results or on the taglist sidebar, without the tag "truly" being associated to the image. This way, if someone wants to change/remove an implication for any reason, there is no reversal work to do; nintendo will no longer imply super_mario, and the search and taglist checks will not add it erroneously.

As is obvious by my pseudo-code, I won't claim that I understand how big of an undertaking this would be, although I must imagine it's at the very least possible (I know Hydrus & Stash manage tags this way). Maybe this goes beyond the use desired by the dev; if so, maybe someone can spin up a fork or something.

G1org1owo commented 1 year ago

The problem with your approach of using "symbolic tags" is that the tag count will inevitably become imprecise, and I don't think that is something the dev wants. Other than that, I can try my hand at it and see if I can get a fork out.

In my opinion, the best course of action is to force the user to confirm when trying to add implications, and then retroactively apply these implications. Of course, doing so makes it really hard to undo what you have done in case of mistakes, unless we implement a whole new undo functionality.

gljames24 commented 10 months ago

I think this would be really useful. I personally would like to be able to search with implications. I would love to be able to look up "headwear" and it look up every hat and headset that has headwear in its implications.

G1org1owo commented 10 months ago

Another problem here would be if there were some cases in which an implicated tag gets removed from an image, it would still get returned by the search, e.g. if hatsune_miku implies blue_hair but there's an image where she actually has pink_hair instead, searching for blue_hair would still return that image although she clearly doesn't have blue hair.

I guess it could be bypassed by adding a search option to allow for "symbolic tags" or something like that, which switches from the usual search to this kind of search @myalow was talking about

Octelly commented 9 months ago

@G1org1owo that seems like an incorrectly set up tag for example: a character might usually be female, but there will inevitably be male interpretations out there, so the character tag should not imply female, even if official lore is that they are female

G1org1owo commented 9 months ago

I see what you mean, guess I have been using implications the wrong way then. I'd try to push out a test branch for implication searching but the last time I tried to wrap my head around the db code I gave up after half an hour, it should be doable after all though

Octelly commented 9 months ago

@G1org1owo Just to be clear, I think that your use-case is valid, but what I've described is how this usually gets managed on big boorus like e621 (18+, not linking to it), which in my opinion is one of the few boorus with visible effort being put into making their tags make sense; just check their tag wiki.