shimmie2
shimmie2 copied to clipboard
add extension: hide_tags
why this extension
I made this feature for my booru so I could arbitrarily "soft hide" posts, while still making them visible if you have the post_id (eg if you link to an image hosted on the booru elsewhere). I wanted this because I wanted to essentially treat my booru mostly like a themed booru, but I also wanted the ability to treat it a bit like a generic image host, but if I post whatever on it, then people who come to the booru for the theme will see all the non-themed posts! This will not do! I know the "private" addon does the same thing but that opens the booru up to be more of a "private image host", and that's not quite what I want either, I just want to be able to casually hide images without too much fuss. It's not "well hidden", and it's not fully visible, just something in between :)
It can probably be used for other things too? 🤔
I don't suggest merging it in as is, because It's not "clean enough" imo. I kinda "hacked it together" without too much thought. I'll try annotate the code with some PR comments of my own.
features
- if you tag a post with the now special tag
hiddenthe post will be hidden! (the way it does this is by injecting the string-hiddento all searches) - if you search for posts with the now special tag
show_hidden, it will let you search normally across allhiddentagged posts as well.
This seems like a useful feature - as to the implementation, adding a new search term into the query behind the scenes is probably the cleanest way; but right now it's only possible to add a whole extra condition to the database query, not possible to add a tag in among the other tags -- #920 should make this possible (and then in your own extension, you can react to SearchTermParseEvent(term=null) (ie, reacting to the fact that a search string is being parsed, not any specific term within the string) by adding a new TagCondition(tag="hidden", positive=false))