Commit Graph

9283 Commits

Author SHA1 Message Date
evazion
f6fb3c0169 search: clean up pool: metatag. 2020-04-21 00:31:16 -05:00
evazion
34d4344eaf search: fix exception on nil searches.
6ca42947bd (commitcomment-38622036)
2020-04-21 00:31:16 -05:00
evazion
8c3d979a8d Update ruby gems and yarn packages. 2020-04-21 00:31:16 -05:00
evazion
ee13a56499 Merge pull request #4416 from nonamethanks/fix_artstation_underscore
Artstation: artists can have underscore in their name
2020-04-21 00:30:33 -05:00
evazion
fef90b46ee search: clean up filetype: metatag.
* Fix not being able to use the filetype: metatag twice in the same search.
* Support comma-separated filetypes (filetype:png,jpg).
2020-04-20 04:14:24 -05:00
evazion
c92ac9ab89 search: clean up status: metatag.
* Fix not being able to use the status: metatag twice in the same search.
* Fix status:active excluding banned posts.
* Fix status:garbage returning all posts.
2020-04-20 04:14:24 -05:00
evazion
c452aa6c78 search: add exclusive range syntax (id:5...10).
Support exclusive ranges for numeric metatags. For example, `id:5...10`
is equivalent to `id:>=5 id:<10`. Useful for splitting searches into id
ranges without the endpoints overlapping: id:100...200, id:200...300,
id:300...400.
2020-04-20 04:13:01 -05:00
evazion
25159bb21c search: support backwards ranges.
Fix things like age:1y..2y or score:5..0 returning no results.
2020-04-20 02:44:09 -05:00
evazion
172095730c search: support repeated numeric-valued metatags.
Support using the same numeric-valued metatag twice in the same search.
Numeric-valued metatags are those taking an integer, float, filesize, or
date argument. Previously using the same metatag twice would cause the
second metatag to overwrite the first metatag.

Examples:

* "id:>5 id:<10"
* "width:>500 width:<1000"
* "date:>2019-01-01 date:<2020-01-01"
2020-04-20 02:44:09 -05:00
evazion
53e5d96bb0 search: support repeated parent: metatags.
Support using the parent: metatag twice in the same search ("parent:1 parent:2").
2020-04-20 02:08:22 -05:00
evazion
43067703b0 search: clean up date range parsing. 2020-04-19 13:48:07 -05:00
evazion
6ca42947bd search: support quoted values for all metatags.
Support using quoted values with all metatags. For example: user:"blah blah",
pool:"blah blah", commentary:"blah blah", etc. Things like rating:"safe",
id:"42" also work. Both single and double quotes are supported.

Also make the status: and rating: metatags fully free. Before only
status:deleted and rating:s were free.
2020-04-19 02:54:44 -05:00
evazion
7726563733 search: refactor scan_query callers to use split_query.
Refactor to use split_query instead of scan_query to split a query on
spaces. Preparation for refactoring scan_query into something smarter.
2020-04-19 02:54:44 -05:00
evazion
d0c68e68c2 search: move search tests to own file. 2020-04-19 02:54:39 -05:00
evazion
621b22111e search: clean up pixiv:<any|none> handling.
Refactor so that all metatags that use parse_helper (which is most
integer-valued metatags) support the special "any" and "none" keywords.

This is mainly for consistency, since it's really only useful for using
width:none and height:none to find for certain old unsupported filetypes
that have null width/height values.
2020-04-19 01:34:14 -05:00
evazion
824d0d8edb search: clean up mpixels:, filesize: tolerance handling.
Fold parse_helper_fudged into parse_helper. This is used to make
mpixels:N and filesize:N do an inexact match with a 5% error tolerance.
For example, filesize:1mb is really equivalent to filesize:0.95mb..1.05mb
because an exact filesize:1mb search is unlikely to match anything.
2020-04-19 01:34:14 -05:00
evazion
fdaaf6e371 ip bans: fix wrong name being logged when bans are deleted. 2020-04-19 01:34:14 -05:00
evazion
ab4d596ac2 Fix #4405: Post version table css doesn't keep ratio at smaller resolutions.
Bug: extremely long sources cause the Tags column to become extremely
wide. Caused by the source link not having the word-break property set.

Fix: use post_source_tag, which lets the `a[rel=external] { word-break: break-word; }`
rule take effect.

Example: https://danbooru.donmai.us/post_versions?search%5Bpost_id%5D=3809742
2020-04-17 01:46:14 -05:00
evazion
94180d77b4 dark mode: fix <kbd> tag colors.
Use a light background for <kbd> tags on the keyboard shortcuts page for
better contrast with the page backgorund.
2020-04-17 00:39:16 -05:00
evazion
698f742046 keyboard shortcuts: document 'Z' key (fix #4390). 2020-04-17 00:35:47 -05:00
evazion
c1ce5024e4 search: fix bug with negated user metatags.
Bug: searching for "filetype:jpg -user:evazion" would negate the
filetype:jpg metatag too. This was because the -user:<name> metatag was
negating the entire cumulative relation instead of just the user:<name>
clause.
2020-04-17 00:29:09 -05:00
evazion
99e7e359af flags/appeals: limit flag/appeal reasons to 140 characters. 2020-04-17 00:13:06 -05:00
evazion
e848011080 Fix #4406: Add "commentary:" metasearch.
Add:

* commentary:true (posts with commentary)
* commentary:false (posts without commentary)
* commentary:translated (posts with translated commentary)
* commentary:untranslated (posts with untranslated commentary)
* commentary:"text" (posts where any commentary field matches "text")

Known issues:

* There's no way to escape the true, false, translated, or
  untranslated keywords to do a literal text search for commentaries
  containing one of these keywords.

* Negated searches may be slow. Using a left outer join instead of a
  subquery would be faster in most cases, but negating it is harder.
2020-04-17 00:11:00 -05:00
evazion
9901161bbf search: rename artcomm metatag to commentaryupdater.
* Rename the artcomm:<user> metatag to commentaryupdater:<user>.
* Add support for negated -commentaryupdater:<user> searches.
2020-04-16 21:06:51 -05:00
evazion
8009699cf7 search: fix searches for private favorites raising privilege errors.
* Fix fav:<user> searches to return no results instead of raising a
  UserPrivilege error when the user has private favorites.

* Fix fav:<nonexistent_user> raising a UserPrivilege error instead of
  returning no results.

* Fix -ordfav:<user> not being supported.
2020-04-16 21:06:15 -05:00
evazion
f8d420d6c0 search: fix searches for private favgroups raising privilege errors.
Change favgroup:<name> searches to return no results instead of raising
a UserPrivilege error when an unpermitted user searches for a private
favgroup.

Partial fix for #4389.
2020-04-16 21:05:50 -05:00
nonamethanks
804c87a0ea Artstation: artists can have underscores in their name 2020-04-17 01:10:23 +02:00
evazion
3aa80c8dc4 Fix #4404: Wrong error message when disapproving an already active post. 2020-04-15 01:18:41 -05:00
evazion
432668ddef Update ruby gems and yarn packages. 2020-04-15 01:18:41 -05:00
evazion
3691404a8d search: fix invalid rating searches returning wrong results.
Partial fix for #4389.

* Fix "rating:asdf" returning all posts.
* Fix "rating:s rating:q" returning results for rating:q.
2020-04-15 01:18:41 -05:00
evazion
be27423afd search: fix invalid username searches returning wrong results.
Partial fix for #4389.

* Fix invalid username searches returning all posts instead of no posts.
* Fix "user:A user:B" returning results for user:B instead of no results.
* Fix "approver:A approver:B" returning results for approver:B instead of no results.
* Add support for negated -commenter, -noter, -noteupdater, -upvote, -downvote metatags.
* Add support for "any" and "none" values for all username metatags,
  including negated metatags that didn't support "any" or "none" before.
* Change noter:any and commenter:any to include posts with deleted notes
  or comments. Note that commenter:<username> already included deleted
  comments before. This is so that commenter:any has the same behavior
  as commenter:<username>
2020-04-15 01:18:41 -05:00
evazion
dc6575dc76 uploads: fix corrupted image detection.
* Fix corrupted image detection. We were shelling out to vips and trying
  to grep for error messages, but the error message for jpeg files changed.
  Now we load the file in ruby vips, which raises an error on failure.

* Don't attempt to redownload corrupted images. If a download completes
  without any errors yet the downloaded file is corrupt, then something is
  wrong at the source and redownloading is unlikely to help. Let the
  upload fail and the user retry if necessary.

* Validate that all uploads are uncorrupted, including files uploaded
  from a computer, not just files uploaded from a source.
2020-04-13 15:30:17 -05:00
evazion
cc31eeafa4 Merge pull request #4401 from lllusion3469/tumblr_2048
tumblr: pick biggest image based on resolution
2020-04-09 23:46:24 -05:00
evazion
04fa913362 Merge pull request #4399 from nonamethanks/master
Post#normalized_source: Normalize more twitter urls
2020-04-09 23:38:49 -05:00
evazion
17abfafe4d Merge pull request #4394 from lllusion3469/fav-vote-buttons
Show or hide post vote buttons when (un)favoriting
2020-04-09 23:34:03 -05:00
evazion
11da2090b5 Merge pull request #4400 from lllusion3469/favgroup-show-deleted
Show deleted posts for favorite groups
2020-04-09 23:25:14 -05:00
lllusion3469
65fb0cf510 tumblr: pick biggest image based on resolution
photo[:alt_sizes] may contain a bigger image than
photo[:original_size]

fixes #4324
2020-04-08 16:42:17 +02:00
nonamethanks
23812aaeb5 Post#normalized_source: Normalize more twitter urls 2020-04-08 13:38:02 +02:00
evazion
c9d5b168e5 ip bans: fix ip addresses with trailing spaces being invalid. 2020-04-07 18:47:51 -05:00
evazion
16011771f1 ip bans: rename ban types to full and partial.
Rename ban types from "normal" and "signup" to "full" and "partial".
2020-04-07 14:59:46 -05:00
evazion
bfdb0a4f5e notes: fix note text vertically overflowing note body.
Can happen when the translator intentionally sets a note body height
that's too small for the note and it causes the note text to overflow.

ref: https://danbooru.donmai.us/forum_topics/9127?page=301#forum_post_164787
2020-04-07 14:16:51 -05:00
evazion
8001272170 gems: remove pry-inline and awesome_print gems.
The current release of pry-inline is broken. Neither of these gems were
that useful anyway.
2020-04-07 14:07:45 -05:00
evazion
b3238c5dbe dtext: fix scrunched table columns.
Fix table columns being collapsed to one character wide in certain
cases. Caused by setting `word-break: break-word` on div.prose, which
was needed to stop very long unbroken strings making columns too wide,
but has the opposite effect of making columns too narrow in other cases.

Example: https://danbooru.donmai.us/forum_topics/13868?page=28#forum_post_164950
2020-04-07 14:05:46 -05:00
lllusion3469
9e8740f746 Show deleted posts for favorite groups
also link to the proper post search with status:any

fixes #4347
2020-04-07 17:16:38 +02:00
lllusion3469
eb564a4ef2 Show or hide post vote buttons when (un)favoriting
When favoriting/unfavoriting a post, it would also be upvoted/"un"voted
but the upvote/downvote/undo vote buttons would stay shown/hidden as
they were before unlike when pressing those buttons.

For example when you want change from favorite to merely upvoted you
would have to reload the page in between.
2020-04-07 02:15:21 +02:00
evazion
6d615001e4 users: add user name blacklist. 2020-04-06 14:13:22 -05:00
evazion
1e0f6f730a uploads: only let users see their own uploads on /uploads listing. 2020-04-06 14:13:22 -05:00
evazion
b2ee1f0766 ip bans: add hit counter, deleted flag, new ban type.
* Make IP bans soft deletable.
* Add a hit counter to track how many times an IP ban has blocked someone.
* Add a last hit timestamp to track when the IP ban last blocked someone.
* Add a new type of IP ban, the signup ban. Signup bans restrict new
  signups from editing anything until they've verified their email
  address.
2020-04-06 14:13:22 -05:00
evazion
98e84d83fb Update ruby gems and yarn packages. 2020-04-06 14:13:22 -05:00
evazion
3fea5858b1 user upgrades: update incentive descriptions.
* Call them hidden tags instead of censored tags so that users don't
  think that buying gold removes censorship from images (yes, this happened).

* Remove API ratelimit information (not relevant to most users).
2020-04-06 14:13:21 -05:00