Commit Graph

11595 Commits

Author SHA1 Message Date
nonamethanks
67534a5482 Modqueue: remove self_upload from highlighted tags 2022-08-28 00:54:26 +02:00
evazion
5795a651f1 ai tags: fix add/remove button size.
Fix it so the Add/Remove button stays the same size and doesn't shift
the layout when transitioning between states.
2022-06-26 01:29:42 -05:00
evazion
54e2bbd86b posts: fix has_tag? method.
Fix a bug where `Post#has_tag?` would return false for tags that
contained colons. This caused the /ai_tags page to incorrectly say
certain tags weren't present on the post.
2022-06-26 01:07:12 -05:00
evazion
97db0e6db3 ai tags: respect the user's posts-per-page setting on the /ai_tags page. 2022-06-26 00:44:01 -05:00
evazion
e5879f0def ai tags: add buttons for quickly adding and removing tags on the /ai_tags page.
Add "Add" and "Remove" buttons beneath thumbnails on the /ai_tags page.
These let you add the tag to the post if it's correct, or remove it if
it's wrong.
2022-06-26 00:43:57 -05:00
evazion
7b1f6e42c1 posts: add "Absurd" size option to thumbnail size menu.
Add option for "Absurd" (720px) size thumbnails to the thumbnail size
menu. 720px size thumbnails require .webp support so they won't work in
older browsers.
2022-06-25 21:53:27 -05:00
evazion
c059b4a39a ai tags: add ability to filter by confidence in post searches.
Allow searching for e.g. `ai:solo,>=90%` to to find posts that have the
solo tag with >=90% confidence. The default confidence level is 50%. The
delimiter is a comma because it's one of the few characters not allowed
in tag names.
2022-06-25 21:51:48 -05:00
evazion
97ba21e615 ai tags: add ability to order /ai_tags page by confidence. 2022-06-25 21:51:14 -05:00
evazion
d3267a5ffa user upgrades: fix button when upgrades are disabled. 2022-06-24 15:14:18 -05:00
evazion
bec9e5a5d9 ai tags: fix broken "Unposted" link on /ai_tags page. 2022-06-24 08:42:40 -05:00
evazion
de261bc321 ai tags: enable filtering by unposted media assets.
Enabled filtering by posted media assets on the /ai_tags page. This was
disabled in development because it was too slow, but seems to be fine in
production.
2022-06-24 08:35:39 -05:00
evazion
2adffb4f92 ai tags: fix broken links to unposted media assets.
Fix thumbnails on the /ai_tags page not linking to media assets correctly.
2022-06-24 08:33:07 -05:00
evazion
1aeb52186e Add AI tag model and UI.
Add a database model for storing AI-predicted tags, and add a UI for browsing and searching these tags.

AI tags are generated by the Danbooru Autotagger (https://github.com/danbooru/autotagger). See that
repo for details about the model.

The database schema is `ai_tags (media_asset_id integer, tag_id integer, score smallint)`. This is
designed to be as space-efficient as possible, since in production we have over 300 million
AI-generated tags (6 million images and 50 tags per post). This amounts to over 10GB in size, plus
indexes.

You can search for AI tags using e.g. `ai:scenery`. You can do `ai:scenery -scenery` to find posts
where the scenery tag is potentially missing, or `scenery -ai:scenery` to find posts that are
potentially mistagged (or more likely where the AI missed the tag).

You can browse AI tags at https://danbooru.donmai.us/ai_tags. On this page you can filter by
confidence level. You can also search unposted media assets by AI tag.

To generate tags, use the `autotag` script from the Autotagger repo, something like this:

  docker run --rm -v ~/danbooru/public/data/360x360:/images ghcr.io/danbooru/autotagger ./autotag -c -f /images | gzip > tags.csv.gz

To import tags, use the fix script in script/fixes/. Expect a Danbooru-size dataset to take
hours to days to generate tags, then 20-30 minutes to import. Currently this all has to be done by hand.
2022-06-24 04:54:26 -05:00
evazion
ae9495ec7c discord: allow only rating:g posts in SFW channels. 2022-06-08 17:36:49 -05:00
evazion
06f75c39a1 footer: remove app name and 2257 link. 2022-06-06 01:00:02 -05:00
evazion
4364516f2b posts: change safe mode to only allow rating:g posts. 2022-06-06 00:56:52 -05:00
evazion
ca289d869c Merge pull request #5199 from NamelessContributor/patch-1
Add back social icons to site footer.
2022-06-05 15:56:53 -05:00
evazion
7149845677 Merge pull request #5202 from nonamethanks/fix-nicoseiga-oekaki-bad-tag
Nicoseiga: normalize oekaki links
2022-06-05 15:56:37 -05:00
evazion
821b97b4e2 Merge pull request #5201 from nonamethanks/fix-deviantart
Deviantart: fix regression in 3a0a32b98a
2022-06-05 15:56:06 -05:00
evazion
acc4a21687 posts: allow admins to approve the same post twice.
This is so admins can overrule flags and always have the final say in whether a
post is approved, even in the event of coordinated or sockpuppet flagging.

Fixes #4980: Way to mark flags as invalid for admins
2022-06-05 15:51:58 -05:00
evazion
907194fc6f commentaries: move search form to /artist_commentaries page.
* Move the commentary search form to the /artist_commentaries page.
* Add Order field for changing the sort order.
2022-06-05 14:28:44 -05:00
evazion
05df3a194c posts: add more free metatags.
The following metatags no longer count against the tag search limit:

* is
* id
* date
* age
* filesize
* filetype
* parent
* child
* md5
* width
* height
* duration
* mpixels
* ratio
* score
* upvotes
* downvotes
* favcount
* embedded
* tagcount
* pixiv_id
* pixiv

These are mostly metatags that have to do with properties of the post
itself. Other metatags still count because they involve things like
subqueries or joins, or they're more tag-like in function.
2022-06-05 14:28:44 -05:00
nonamethanks
e7584c7e0a Nicoseiga: normalize oekaki links 2022-06-04 22:57:54 +02:00
nonamethanks
2fd8e9bc14 Deviantart: fix regression in 3a0a32b98a 2022-06-04 20:26:14 +02:00
NamelessContributor
6e8b43bd69 Add back social icons to site footer.
Revert 1720246cb9 and f668cfdbac
2022-06-03 16:30:38 +02:00
evazion
ea92cbff4e user upgrades: update upgrade page text. 2022-06-02 14:40:42 -05:00
evazion
fec92d765a users: change default blacklist to furry -rating:g. 2022-06-02 00:06:34 -05:00
evazion
b02dbf1a43 Fix broken Docker build.
terser-webpack-plugin 5.3.2 was a bad release, which broke the Docker build.
2022-06-01 21:26:20 -05:00
evazion
2e249103e1 Update Ruby gems and Yarn packages. 2022-06-01 20:20:12 -05:00
evazion
572c58d115 Merge pull request #5187 from Hyozen1/patch-1
Allow background-clip and -webkit-background-clip properties in notes
2022-06-01 19:26:06 -05:00
evazion
cc2285ed6f Merge pull request #5188 from nonamethanks/fix-deviantart
Fix deviantart strategy to get biggest available size
2022-06-01 18:39:43 -05:00
evazion
434e44ba8b Merge pull request #5197 from nonamethanks/fix-bur-links
BURs: don't allow edits to approved scripts
2022-06-01 18:37:09 -05:00
evazion
173e43b192 user upgrades: add upgrade code system.
Add a system for upgrading accounts using upgrade codes. Users purchase
an upgrade code off-site then redeem it on-site to upgrade their account
to Gold. Upgrade codes are randomly pre-generated and are one time use
only. Codes have enough randomness that guessing a code is infeasible.
2022-06-01 18:31:46 -05:00
Hyozen1
547af83af8 Add background-clip and -webkit complementar properties to notes 2022-06-01 18:55:18 -03:00
nonamethanks
5932d8d3a3 BURs: don't allow edits to approved scripts
Also fix bad formatting for non-admins in BUR index
2022-06-01 14:07:30 +02:00
nonamethanks
3a0a32b98a Fix deviantart strategy to get biggest available size 2022-05-27 17:07:22 +02:00
evazion
7786fbaca6 Fix #5181: Old post versions have null ratings which causes a KeyError. 2022-05-22 23:50:45 -05:00
evazion
81bd86d202 posts: add "general" rating; rename "safe" rating to "sensitive".
* Add "general" rating.
* Rename "safe" rating to "sensitive".
* Change safe mode to include both rating:s and rating:g.
* Treat rating:safe as a synonym for rating:sensitive.
* Link "howto:rate" in the post edit form.
2022-05-22 13:38:45 -05:00
evazion
d346adabc9 Revert "posts: fix rounding errors in ratio: metatag."
This reverts commit 80ced3e418.

This turned out to be intentional. Rounding the aspect ratio to 2
decimal places is so that searches for exact ratios like `ratio:16:9` or
`ratio:1.78` work even when the ratio doesn't exactly match. Rounding to
2 decimal places means that the ratio: metatag has a 1% error tolerance.
2022-05-22 12:37:26 -05:00
evazion
c6b5be1c9f Update Danbooru logo. 2022-05-22 02:53:22 -05:00
evazion
ed1629bc7d Update Danbooru logo. 2022-05-21 23:26:46 -05:00
evazion
276850d2b1 Update Danbooru logo. 2022-05-21 21:39:44 -05:00
evazion
e7c507b7fc css: adjust spacing around header on mobile. 2022-05-21 14:57:49 -05:00
evazion
80ced3e418 posts: fix rounding errors in ratio: metatag.
Fix the ratio: metatag sometimes including wrong results due to rounding
errors. For example, searching for `ratio:>=4.0` would include post
3220414, which has an aspect ratio of 3.99879. This would get rounded up
to 2 decimal places to 4.00.
2022-05-21 14:08:50 -05:00
evazion
e53e8da3a1 Fix #5171: Don't allow wide_image and tall_image to be manually tagged. 2022-05-21 14:01:31 -05:00
evazion
d89db73c2f Add site logo to header. 2022-05-21 13:30:21 -05:00
evazion
1bcf93b816 Fix #5178: Add received bans to user includes. 2022-05-20 23:03:22 -05:00
evazion
9867514a78 Fix #5177: ordfav with commentary search raises exception. 2022-05-20 22:59:02 -05:00
evazion
0fe9356bf6 tests: fix broken tests. 2022-05-20 22:51:02 -05:00
evazion
1e78b97eb8 Add config options to disable comments and the forum.
Add options to disable comments, the forum, and autocomplete. This is
for personal boorus and potentially for safe mode. Note that disabling
the forum may cause difficulties with creating and approving BURs.

Disabling comments and the forum merely hides them from most areas,
rather than completely removing them.
2022-05-18 14:45:40 -05:00