Topic: Mass Unfavoriter

Posted under e621 Tools and Applications

I've seen a few requests of people in the discord to essentially clear their favorites. E621 does not provide this feature by default, but it is automatable thanks to the API.

I made a small page on my site where you can do this, and it also allows for filtering what you will be unfavoriting. The filter syntax is identical to my advanced search syntax, however it does not support metatags.

You can find the page here. If you are using this, I highly recommend using the first button first which will show you all the posts you will be unfavoriting. This is so you can ensure that the filter is working.

The API does have a rate limit, so the more you need to unfavorite, the longer you will need to keep the page open. It will tell you how long the process will take and alert you when it is finished. The page is very simple, so do not expect fancy UI.

The code behind this can be found with the rest of the site, at its github, here

Let me know if you run into any issues, my limited testing seemed to work.

definitelynotafurry4 said:
I've seen a few requests of people in the discord to essentially clear their favorites. E621 does not provide this feature by default, but it is automatable thanks to the API.

i never even thought about this.

Strictly from a database performance POV, it would be lot less expensive to be able to submit a range of posts to remove instead of a list or doing it one-by-one in a batch.

alphamule said:
Strictly from a database performance POV, it would be lot less expensive to be able to submit a range of posts to remove instead of a list or doing it one-by-one in a batch.

I'm not sure if it's possible to unfavorite multiple at a time like that. I'm just going off of what I saw in the api docs, which don't show any way of unfavoriting many at once. What was suggested in the discord to these people was to go to your favorites, set the mode to unfavorite then click every post. Which does it one by one like this using the exact same endpoint. So doing it like this is the exact same as manually doing it the suggested way, just you don't gotta click them all.

Though I do agree. E6's api, unfortunately, lacks many bulk requests that would otherwise very significantly increase performance for both api users and the database itself since batches are faster to process than single items. Regardless, if you know a way to unfavorite many at once via the api, then let me know!

Updated

There is indeed no way to do that in bulk, though if you have many (thousands), and want them all gone, you can beg a developer in the discord to nuke your favorites
They've nuked someone's 80,000 favorites before

definitelynotafurry4 said:
I'm not sure if it's possible to unfavorite multiple at a time like that. I'm just going off of what I saw in the api docs, which don't show any way of unfavoriting many at once. What was suggested in the discord to these people was to go to your favorites, set the mode to unfavorite then click every post. Which does it one by one like this using the exact same endpoint. So doing it like this is the exact same as manually doing it the suggested way, just you don't gotta click them all.

Though I do agree. E6's api, unfortunately, lacks many bulk requests that would otherwise very significantly increase performance for both api users and the database itself since batches are faster to process than single items. Regardless, if you know a way to unfavorite many at once via the api, then let me know!

It's likely intentional. This is a rare use case, and if you had more than a few people doing it at once, the benefits of it would be neglected. Frigging I/O and cache contention. But yes, just being able to request nuking of an entire range would be one way.

alphamule said:
It's likely intentional. This is a rare use case, and if you had more than a few people doing it at once, the benefits of it would be neglected. Frigging I/O and cache contention. But yes, just being able to request nuking of an entire range would be one way.

Eh, using opensearch, which is what e6 currently uses, a bulk removal of posts from a favorite list would probably take a few milliseconds at most. If anything the actual "expensive" part of the process would be updating tag counts across multiple posts, but opensearch, being a fork of elasticsearch, has a built in bulk operations that executes them asynchronously. Updating at most <200k posts (max favorites is somewhere around there) really shouldn't take any time at all, especially using opensearch's bulk api, which handles all the I/O for you. I should be clear, though, I'm not entirely sure how e6's database works. For that matter, I'm not actually sure if users are a part of that opensearch database, or if they're in a different database, which I think would make more sense, but I've never personally looked into it.

I think most of the reason that it doesn't exist is because most people don't go mass unfavoriting, but the problem is some people do, which is why I made the tool in the first place. I expect it to probably never get used, but it is here if someone finds a need for it. Even if it takes 44 hours to remove 200,000 favorites, it is still probably faster than a human lmao, and it won't get exhausted or get carpal tunnel from repetitive strain.

Updated

This now supports sets. You must use the id though.

Here's a few examples:

  • set:1 will unfavorite all posts in the set with the id 1
  • set:1 ~ set:2 will unfavorite all in the sets with the id 1 or 2
  • set:1 -set:2 will unfavorite all in set 1 that aren't also in set 2

You can use these in groups like you would other tags. This is a client-sided thing, so it only works for the mass unfavoriter, and not across all my tools that use the advanced search syntax. So

  • ( set:1 female ) ~ ( set:2 male ) would unfavorite all posts in set 1 with the female tag and all posts in set 2 with the male tag.
  • 1