avoonix / material-e621

Material e621 is a modern, open source web client for e621.net. It is customizable, comes with a bunch of additional features that are not available on e621.net, and makes browsing posts a delightful experience.
https://material-e621.vercel.app
GNU Affero General Public License v3.0
54 stars 6 forks source link

[Feature]: Import blacklist #21

Closed unknowner00 closed 8 months ago

unknowner00 commented 11 months ago

Description

I am unsure if you could do this using the API key, so I won't focus on that here.

The blacklist is composed of elements, separated by line, which can be copied by the user. This can easily be converted into the json file used by the importer. Here is an example blacklist:

low_res
anthro -tail
standing

You can add quotes around every line,

"low_res"
"anthro -tail"
"standing"

Put a comma after every line, (except the last one)

"low_res",
"anthro -tail",
"standing"

Remove all line breaks,

"low_res","anthro -tail","standing"

And insert it into the blacklist section.

"blacklist":{"mode":0,"tags":["low_res","anthro -tail","standing"]}

Modifying the file like this, and importing it, has worked on my end.

avoonix commented 11 months ago

I can't deal with a group of tags (unless I missed something or the e6 API changed). This app just takes all tags from the blacklist and adds it to the query with - prepended, so the anthro -tail line will behave differently than on e6.

avoonix commented 8 months ago

Now it should work as expected. The previous blacklist settings will be converted to the new format automatically, but if you still have the anthro -tail as single tag, it will not work.

The new config should look like this:

[
  ["low_res"],
  ["anthro", "-tail"],
  ["standing"]
]

(or you can use the importer)