Commit Graph

1329 Commits

Author SHA1 Message Date
Earlopain
3187ee169b
[TagRelations] Require a reason on create 2022-05-22 18:59:45 +02:00
Earlopain
98ab543e59
[TagRelations] Refactor alias/implication request code 2022-05-22 17:05:12 +02:00
Earlopain
3108613b0e
[EmailBlacklist] Unverify existing users on create 2022-05-22 15:21:41 +02:00
Earlopain
2b079eabb9
[PostEvent] Fix unflag event on approve not being created 2022-05-22 14:47:11 +02:00
Earlopain
93cd28c0e1
[Posts] Change comment locked to disabled
Instead of just preventing new comments hide everything completly.
2022-05-16 15:53:39 +02:00
Earlopain
2f5b55a0bc
[Comments] Hide a few buttons on sticky 2022-05-16 14:42:44 +02:00
Earlopain
6d3f272e90
[Posts] Allow locking comment sections 2022-05-16 14:20:11 +02:00
Earlopain
c9f14e7836
[Replacements] Run full file validation on create 2022-05-08 20:47:11 +02:00
Jason Gronn
23253d6766
[Comments] Disable downvoting own comment (#397)
* Disable downvoting own comment; hide vote buttons for own comment

* Revert hiding buttons; merge upvote/downvote paths; fix tests that relied on previous behaviour

* Undo some changes I did not mean to make

* Fix a mistake I made

* Fix some other unit tests
2022-04-30 12:48:53 +02:00
Earlopain
e18a2602b6
[Tests] Small amount of fixes 2022-04-21 21:23:33 +02:00
Earlopain
20146b106d
[Tests] A bunch of more fixes 2022-04-13 08:54:50 +02:00
Earlopain
0e60ac29f9
[Cleanup] Remove mb_chars usage
Ruby 2.4 supports this natively
2022-04-09 14:23:12 +02:00
Earlopain
029fabc279
[Cleanup] Remove merge_version? 2022-04-08 11:49:58 +02:00
Earlopain
0d50202bbd
[Tests] Fix a bunch
1269 runs, 2237 assertions, 68 failures, 27 errors, 0 skips
2022-04-07 18:23:20 +02:00
Earlopain
10d09700fb
[Cleanup] Remove TagChangeNoticeService 2022-04-07 18:14:15 +02:00
Earlopain
841610cd90
[Tests] Fix a few tests related to elasticsearch
Namespace the indicies, this should stop the search being messed up
after running tests. Also refresh the index immediately, this slows down
tests a bit but gets rid of a few failures. This whole search testing needs
to be revised some time.

Run this to fix your development setup:
```
Post.__elasticsearch__.create_index!
Post.import
PostArchive.__elasticsearch__.create_index!
PostArchive.import
```
2022-04-05 19:24:31 +02:00
Earlopain
3740599920
[Tests] Fix a bunch of tests 2022-04-05 18:50:34 +02:00
Earlopain
4c44b3aa32
[Search] Remove instance variables named search
They seem to have special meaning in `simple_form_for?`
2022-04-02 17:43:16 +02:00
Earlopain
f7d1ad0810
[Tests] Fix apng tests 2022-03-29 19:40:01 +02:00
Earlopain
ec559f1a34
[Tests] Fix some comment tests 2022-03-28 21:17:34 +02:00
Earlopain
d4d37a7cd2
[Tests] Remove unused tests
Looks like I forgot to remove this some time.
Also remove stray `puts`
2022-03-21 15:39:27 +01:00
Earlopain
92a0a36589
[Cleanup] Remove upload referer_url 2022-03-16 17:39:58 +01:00
Earlopain
3aa731c408
[Cleanup] Don't return strategy on download 2022-03-16 17:15:45 +01:00
Earlopain
ee8fb64861
[Cleanup] Remove ugoira 2022-03-16 17:08:40 +01:00
Earlopain
2b84f3a4cd
[Tests] Fix disapproval tests
Also updates the reason search dropdown
2022-03-16 15:55:24 +01:00
Earlopain
dd8aa8199b
[Cleanup] Remove modqueue random 2022-03-16 15:48:29 +01:00
Earlopain
55443873a3
[Cleanup] Remove no_feedback 2022-03-16 15:32:24 +01:00
Earlopain
6902434a90
[Replacements] Remove hourly limit
The normal upload limit is still in effect though.
Fixes #379 by completly ignoring the actual problem.
2022-03-05 17:23:53 +01:00
Earlopain
5a88be7d2d
[Cleanup] Remove spam detection
Checked for is_gold, which doesn't work anyways
2022-03-05 16:05:53 +01:00
Earlopain
e01ab43577
[Cleanup] Remove janitor trials 2022-03-05 15:58:30 +01:00
Earlopain
8007881660
[Tests] Fix some password reset tests 2022-02-19 17:34:50 +01:00
Earlopain
2802623642
[Tests] Fix post flag tests 2022-02-19 17:34:14 +01:00
Earlopain
de0311a268
[Cleanup] Remove a few unused files 2022-02-19 17:19:44 +01:00
Earlopain
348827de5d
[Tests] Fix artist tests 2022-02-19 17:07:58 +01:00
Earlopain
e3728546c7
[Cleanup] Remove artist banning 2022-02-19 16:54:26 +01:00
Earlopain
2d94167fab
[Cleanup] Remove Artist.new_with_defaults 2022-02-19 16:04:33 +01:00
Earlopain
ac5e8673ca
[Cleanup] Remove most source strategy code 2022-02-19 15:55:26 +01:00
Earlopain
451e23c121
[Cleanup] Remove dead related tags code 2022-02-19 14:11:49 +01:00
Zwagoth
91d32607f0
Merge pull request #375 from zwagoth/remove-appeals
[Cleanup] Remove post appeals
2022-02-19 02:22:25 -05:00
Earlopain
f7ba9c5043
[Cleanup] Remove post appeals 2022-02-11 17:05:09 +01:00
Earlopain
924e519b4c
[Tests] Fix user feedback tests 2022-02-10 17:58:20 +01:00
Earlopain
c6dae231f0
[Tests] Remove remaining sqs stubs 2022-02-10 17:55:48 +01:00
Earlopain
b1a8c4960c
[Tests] Fix pool tests 2022-02-10 17:53:51 +01:00
Earlopain
533b2c5c1c
[Cleanup] Remove unused maintenance tasks 2022-02-09 15:41:15 +01:00
Earlopain
7aa6adeae4
[Cleanup] Remove donmai specifics 2022-02-09 15:39:18 +01:00
Earlopain
a135c2a592
[Cleanup] Remove reportbooru 2022-02-09 15:39:07 +01:00
Earlopain
5ebc8756c9
[Cleanup] Remove more danbooru specific code 2022-02-03 16:41:10 +01:00
Earlopain
6f8b4001e0
[Cleanup] Remove danbooru cloudflare purge cache functionality 2021-11-20 21:18:29 +01:00
Earlopain
ca370d29be
[Posts] Remove dead source normalization code 2021-11-20 21:49:53 +01:00
Zwagoth
37a9137096
Merge pull request #364 from zwagoth/post-events-log
Post events log
2022-01-31 13:05:05 -05:00
Earlopain
1c6b2dcba9
[Users] Remove special casing for name change feedback
Part of old danbooru code, these feedbacks where never created on e6.
Also remove name change approve/reject controller actions, it's all automatic
2022-01-22 16:20:49 +01:00
Earlopain
22d04f6cb1
[Posts] Add postevent tests 2022-01-07 12:29:11 +01:00
Earlopain
bcccec6778
[Replacements] Add test for upload limit changes 2021-06-27 00:21:01 +02:00
Zwagoth
b2b5938d5c
Merge pull request #325 from zwagoth/replacement-search
[Search] Add pending replacements field
2021-11-17 00:44:19 -05:00
Earlopain
061176e095
[Setup] Ignore limits when seeding
This makes the environment config understand booleans. If something
ends with "?" it tries to interpret it as a boolean. A bunch of
existing configs where changed to reflect this change.
2021-11-14 22:16:36 +01:00
Earlopain
572b61c85c
[Forum] Prevent voting on your own requests
Removing the votes is still possible but adding new ones  isn't.
Closes #341
2021-11-02 16:36:05 +01:00
Earlopain
147ec019e8
[Search] Add pending replacements field 2021-10-05 21:14:00 +02:00
Earlopain
1c0c3c2475
[Flags] Allow viewing flags on own uploaded posts
Apparently  this was a attempt to hide some undesirable information from mods
I personally think this isn't needed and if someone really wanted to
they could just use the other search options which didn't have this limitation
2021-08-06 19:54:18 +02:00
Earlopain
4b7242005a
[Replacements] Fix broken state when rescaling notes
After the note will be saved it reloaded the post, throwing the
previous changes like new md5, size etc. away
2021-06-24 16:22:04 +02:00
Earlopain
eb1f432fc5
Merge branch 'master' into style-changes 2021-06-02 14:28:22 +02:00
Earlopain
8d8a0802a5
[User] Remove memoization of throttles
This interfered with tests and doesn't seem to give much of an advantage
2021-05-15 12:36:29 +02:00
Earlopain
9df05e7ba8
[Tests] Add test for forum post throttles 2021-05-14 17:54:46 +02:00
Earlopain
11f4b5e15b
[Tests] Fix user tests 2021-05-14 17:12:51 +02:00
Earlopain
015c238dca
[Config] Remove member_comment_time_threshold
This was only stubbed in tests and not used anywhere else
2021-05-14 17:07:43 +02:00
Earlopain
a023c2806e
[Tests] Fix forum post/topic tests 2021-05-14 15:04:03 +02:00
Earlopain
bb56d14221
[Favorites] Use limit parameter and update tests
Some tests still fail because of is_last_page/is_first_page, but the syntax is fine now

Fixes #267
2021-05-09 18:57:01 +02:00
Zwagoth
af7f7f9d10
Merge pull request #256 from Earlopain/remove-useless-config
Remove useless config entries
2021-04-18 17:41:12 -04:00
Kira
96c7a76bb8 [Replacements] Do not post comment on replacement 2021-04-16 18:05:22 -07:00
Kira
3bcaa6dacf [Replacement] Add post replacement promote test 2021-04-07 10:33:19 -07:00
Kira
173294fb56 [Replacements] Testing 2021-04-07 10:33:19 -07:00
Kira
2298beaa6c [Tests] Fix post replacement controller tests 2021-04-07 10:33:19 -07:00
Kira
c2e6b16796 Tests and fixes 2021-04-07 10:33:18 -07:00
Earlopain
e7b03a84e9
[Config] remove dead keys 2021-04-03 20:14:15 +02:00
Kira
8ea9419045 [Pools] Fix pool name validator for '_-_'
A bad regex was added which was flagging pool names as invalid
if they contained _-_ in them or ' - '. As these are heavily used
in pool names they should be allowed. But consequitive characters
should still be not allowed.
2021-03-11 00:06:20 -08:00
Kira
5c90693338 [Posts] Allow copying source/tags on delete 2021-03-10 22:39:12 -08:00
Kira
9c6939c302 [Tag Aliases] Don't update locked tag categories on alias approval. 2021-02-28 13:30:28 -08:00
Kira
784890ca3e [Posts] Fix tag set presenter using broken memoist gem 2021-02-25 12:08:09 -08:00
Kira
76d1999ade [Rails] Upgrade to rails 6.1 + fix tests 2021-02-25 12:08:09 -08:00
Kira
e685fb87c2 [Tests] Update tests and fix deprecations 2021-02-25 12:08:09 -08:00
Kira
12cdec9642 [Tests] Remove test for removed class 2021-02-25 12:08:09 -08:00
Kira
fd635ff197 [Tests] Fix vote tests 2021-02-25 12:08:09 -08:00
Kira
e2a7fa1e27 [Tests] Fix favorite tests 2021-02-25 12:08:09 -08:00
Kira
2f416b51b4 [Tests] Fix pool tests
The atomic add! and remove! methods were not properly resetting
the skip_sync property once the pool was updated. This was causing
pool test behavior to fail because later syncronize methods would
fail to sync.
2021-02-25 12:08:09 -08:00
Kira
dbb5870d93 [Tests] Fix pool related errors in tests 2021-02-25 12:08:09 -08:00
Kira
46fe5f1164 [Pools] Pool tests 2021-02-25 12:08:09 -08:00
Kira
c246cd68a2 More test fixes 2021-02-25 12:08:08 -08:00
Kira
8364af65c5 More test fixing 2021-02-25 12:08:08 -08:00
Kira
58e8fe22fd Tests and fixes 2021-02-25 12:08:08 -08:00
Kira
32e81770ef Update tests 2021-02-25 12:00:09 -08:00
Kira
4d996fed54 Update allowed tag naming patterns 2020-12-20 11:31:52 -08:00
Kira
3d82cc3430 [Tag Relations] Remove secondary validations 2020-07-17 01:34:12 -07:00
Kira
160b0cb22e Remove saved searches 2019-10-21 02:57:03 -07:00
Kira
6f74ef28bf Remove broken bulk revert tool 2019-09-28 22:10:23 -07:00
Kira
6fb1e3ceaf Fix up users being broken in tests and fix a few basic tests 2019-09-09 12:58:18 -07:00
Kira
55cb64acf7 Fix deprecated use of update_attributes 2019-09-09 12:58:18 -07:00
evazion
aae3a8edfb artists: reduce queries in artist summaries.
Avoid a few queries when searching for single artist tags.
2019-09-05 06:03:33 -07:00
evazion
ae5d039745 app controller: move safe mode from app controller to SessionLoader. 2019-08-28 21:09:37 -07:00
evazion
4e39ef572e Fix #4125: Detect forum and comment spam. 2019-08-28 20:51:14 -07:00
evazion
30ee20a570 dmails: factor out spam detector service. 2019-08-28 20:48:31 -07:00
evazion
531b5c9845 models: drop various unused #named methods. 2019-08-18 13:35:11 -07:00
Kira
a63a5c3131 Remove caching from tag aliases 2019-08-13 06:04:42 -07:00
evazion
ef806bf340 tests: fix ip ban test regression. 2019-08-13 03:28:27 -07:00
evazion
6beb8a81e1 Fix #4106: Allow moderators to IP ban subnets. 2019-08-13 03:24:26 -07:00
evazion
2cd0355665 Fix #4130: Remove tag alias corrections. 2019-08-13 03:18:39 -07:00
evazion
ec0ae03aef nijie: update for new image urls.
Nijie moved from this:

    https://pic03.nijie.info/nijie_picture/236014_20170620101426_0.png (page: https://www.nijie.info/view.php?id=218856)

to this:

    https://pic.nijie.net/03/nijie_picture/236014_20170620101426_0.png (page: https://www.nijie.info/view.php?id=218856)
2019-08-10 05:40:31 -07:00
evazion
3931fb454b Fix #4053: Add disapproval index improvements.
Add search form to /moderator/post/disapprovals.
2019-08-10 05:39:04 -07:00
evazion
1e7b70c476 Fix #4107: Can't create artist entry if tag already has a wiki #4107 2019-08-10 05:33:43 -07:00
Kira
4024108f1c Convert builder -> janitor for user rank 2019-06-29 12:58:28 -07:00
Kira
9fa294ba31 Convert gold -> privileged for user level 2019-06-29 08:45:58 -07:00
Zwagoth
4a46874a50 Revert "Remove post disapproval"
This reverts commit c6df9a33e0.
2019-04-11 23:39:44 -04:00
Kira
5083e6d92e Remove favorite groups 2019-03-23 00:57:37 -07:00
Kira
f4f030f726 Password migration/upgrade
NOTE: All existing passwords in development no longer work after
this change! Change your users password using the rails console.

Automatically convert and ugrade old passwords to using bcrypt
Removed the seemingly pointless transformation and hashing on top
of the actual password with a static salt.
Disabled logging in using password hashes, because that's just not
secure in any way, and negates cracking passwords at all.
Disabled sending the password hash to the client as a cookie, even
if it was signed.
Disabled legacy API logins.
2019-02-21 21:10:20 -08:00
Kira
c6df9a33e0 Remove post disapproval
This simplifies the approval system to be a single user with an
auditing table. The disapproval system was confusing and outright
post deletion replaces it on e6.

Slightly changes the rules of how post approvals work to remove
a few limits that are not reflected on e6.
2019-02-19 20:20:15 -08:00
Kira
3e8483eaf0 Tests for at least some of the new jobs 2019-02-18 16:29:13 -08:00
Kira
43cad3f5e7 Remove post banning functionality
The distinction between file deletion and banning is pretty weird
and there are a bunch of edge cases that make this not worth
trying to maintain a distinction.

Left in the automatic implication code on banned artists because
it looked useful for automating some of the basic tasks that are
done surrounding DNP artists.
2019-02-14 01:44:54 -08:00
Kira
f9d9fc0c72 Unlink voting and favorite actions
E621 uses a decoupled voting and favorite system to give users
more choices about how they interact with these systems.
2019-02-13 20:36:55 -08:00
Kira
cfd65dc20b Add DNS email blacklist support
Look up the MX records for domains when validating blacklists.

A common trick is to register a domain and point it at a spam
email provider to bypass lists.
2019-02-09 18:57:35 -08:00
Kira
0bd76687a6 Add email blacklist controller 2019-02-09 18:42:43 -08:00
Kira
143e428bab Add email blacklist to user model
Thi allows prevent specific email addresses from being used during
signup or email change.
2019-02-09 14:00:37 -08:00
Kira
21aaa2a185 Add upload whitelist model + controller
Allow preventing uploads from unknown sources by having a whitelist
of allowed domains and patterns that can be directly fetched from.
2019-02-06 21:08:03 -08:00
Kira
4d1f436266 Add locked tags feature
It is desirable for administrators to be able to shape what tags
can and can not be applied to specific posts to cut down on how
many tickets need to be handled about tag vandalism.

TODO: Tell users which tags were not updated if they hit any
locked tags.
2019-02-02 18:03:47 -08:00
Albert Yi
1550538dc1 Tag change notices
This adds a small notice at the bottom of post searches if a single tag search is the target of any tag change request.
2019-01-22 17:22:07 -08:00
evazion
8cadef2dd7 pixiv: fix illust id parsing (fix #4043).
* Tighten up illust id parsing to avoid misparsing ids from
  non-illust urls (sketch urls and novel urls).

* Move id parsing tests from post_test.rb to sources/pixiv_test.rb.

* Drop support for touch.pixiv.net urls. These urls are no longer used
  by Pixiv and aren't present as the source of any posts on Danbooru.
2019-01-13 14:28:51 -06:00
Albert Yi
f33b23d035 add post count estimates for bulk update requests 2019-01-09 15:54:55 -08:00
Albert Yi
844b1a81ba
Merge pull request #4039 from evazion/fix-4038
Fix #4038: Attempting to create an IP-ban bans the creator.
2019-01-09 14:47:32 -08:00
Albert Yi
d97622d1bb
Merge pull request #4007 from evazion/fix-4004
Fix #4004: Add additional order by metatags for posts
2019-01-09 14:43:15 -08:00
evazion
80f43f9a7c Fix #4038: Attempting to create an IP-ban bans the creator.
* Rename comments.ip_addr to comments.creator_ip_addr.
* Fix belongs_to_creator to not clobber ip_addr field.
2019-01-09 16:20:34 -06:00
Albert Yi
8b0af19f7f fixes #3824: render tag requests dynamically in the forum post
refactoring
2019-01-08 12:57:37 -08:00
evazion
5c54c61d65 Fix #4035: The Related Tag JSON endpoint is returning the wrong information
* Fix /related_tags.json to return a list of tags in the `other_wikis` field.

* Add support for /related_tags.xml.
2019-01-07 13:30:10 -06:00
evazion
04d5b16da7 pixiv: fix failure to upload bad pixiv id images (fix #4031)
Bug: Uploading bad pixiv id images failed because the pixiv strategy
raised a BadIDError exception when the upload service checked for the
ugoira frame data.
2019-01-03 18:01:20 -06:00
evazion
886096b47a BURs: fix remove alias command removing inactive aliases.
Fix the `remove alias` and `remove implication` commands to only remove
active aliases or implications, not pending/deleted/retired ones.
2019-01-03 16:30:39 -06:00
Albert Yi
f78ff57884 fix forum topic test 2019-01-02 12:33:56 -08:00
Albert Yi
6f30c99ac3 fix tag alias correction tests
also removes references to distributed memcached servers in tag alias correction
2019-01-02 11:52:35 -08:00
evazion
d393d67a9b aliases/implications: don't destroy removed aliases (#4024). 2018-12-31 17:07:14 -06:00
evazion
f5116c5ce2 aliases/implications: allow duplicate inactive aliases/implications.
Allow multiple pending, deleted or retired aliases/implications for the
same tag.

This is so that deleted or retired aliases can be resubmitted as new
pending requests.
2018-12-31 17:07:14 -06:00
evazion
44a54f75cd tests: don't automatically approve aliases/implications on creation.
Automagically approving inactive aliases makes testing more difficult.
2018-12-31 17:07:14 -06:00
evazion
341403c7bb tests: fix broken bulk update request test. 2018-12-31 17:07:14 -06:00
evazion
6a77b68b74 tumblr: fix tests. 2018-12-27 15:03:11 -06:00
evazion
0f513d1a1b twitter: include intent url in new artist entries (#4028). 2018-12-27 15:03:11 -06:00
evazion
2129e60b2b pixiv: include stacc url in new artist entries (#4028). 2018-12-27 15:03:11 -06:00
evazion
2170961f47 artists: improve prefilling of new artist form (#4028)
* When creating an artist by clicking the '?' next to the artist tag in
  the tag list, prefill the new artist form by finding the artist's last
  upload and fetching its source data.

  Previously we filled the urls with the source of the artist's last
  upload, which was wrong because it was usually a direct image URL (#3078).

* Fix the other names field not escaping spaces within names to underscores.

* Fix the other names field being potentially prefilled with duplicate names.
2018-12-27 15:03:11 -06:00
evazion
286bf2f285 artists: filter out duplicates from other names (#4028). 2018-12-27 15:03:11 -06:00
evazion
3c9b26c247 tests: fix *_(cosplay) tagging test (fixup for 51b08d224). 2018-12-26 20:16:59 -06:00
evazion
719f556dd5 aliases: warn about conflicting wikis when alias is requested.
* Warn about conflicting wiki pages during secondary validation.

* Only warn about missing wiki if both tags are missing a wiki page.
2018-12-26 17:30:07 -06:00
evazion
365e04b5f9 implications: fix validation of circular implications.
Fix bug where circular chains like `a -> b && b -> c && c -> a` were
allowed.
2018-12-26 17:30:07 -06:00
evazion
51b08d2243 implications: ensure antecedent/consequent tags exist. 2018-12-26 17:30:07 -06:00
evazion
c27ba02b88 aliases/implications: clean up validations.
* Don't return true/false in validations (does nothing).
* Prefer `errors[:base]` over `self.errors[:base]`.
* Add antecedent_wiki / consequent_wiki associations.
* Factor out antecedent_and_consequent_are_different validation.
2018-12-26 17:30:07 -06:00
evazion
3e382bd831 Fix #4014: Incorrect tag type counts on posts. 2018-12-19 12:20:29 -06:00
evazion
c700ea4b5f Fix #4016: Translated tags failing to find some tags.
* Normalize spaces to underscores when saving other names. Preserve case
  since case can be significant.

* Fix WikiPage#other_names_include to search case-insensitively (note:
  this prevents using the index).

* Fix sources to return the raw tags in `#tags` and the normalized tags
  in `#normalized_tags`. The normalized tags are the tags that will be
  matched against other names.
2018-12-16 11:37:57 -06:00
Albert Yi
4706cae114 Add user permissions for flagging and for giving user feedback 2018-12-11 17:08:31 -08:00
evazion
ea9c3576d8 search: add synonyms for *_count metatags.
Allow e.g. `deleted_comments` as a synonym for `deleted_comment_count`.
2018-12-11 18:10:20 -06:00
evazion
4a1f0523a4 search: add comment_count, note_count metatags (#4004).
Add these metatags:

* comment_count
* deleted_comment_count
* active_comment_count
* note_count
* deleted_note_count
* active_note_count
* order:comment_count
* order:deleted_comment_count
* order:active_comment_count
* order:note_count
* order:deleted_note_count
* order:active_note_count
2018-12-11 18:10:20 -06:00
Albert Yi
79dfa6c28f fix migration for circleci 2018-12-10 17:51:57 -08:00
evazion
7ae27c370d Fix #3995: Automatically imply *_school_uniform -> school_uniform. 2018-12-05 12:19:27 -06:00
evazion
fd2d56a388 Fix #3996: Some direct artstation urls cause the bookmarklet to fail.
* Don't fail on urls that don't contain the project id (direct image urls).
* Don't fail when the work is deleted.
* Parse artist name from url when possible. This way the artist finder works on bad_artstation_id posts.
* Set canonical source url to `https://artist.artstation.com/projects/12345` instead of
  `https://www.artstation.com/artwork/1235` (this way we preserve the artist name).
* Cache api call.
* Include api call results in /source.json.
2018-12-03 15:48:29 -06:00
evazion
e8c3d92696 Fix #3977: DeviantArt: Support new wixmp.com urls. 2018-11-30 00:10:59 -06:00
evazion
8da3474a8b Fix #3994: Some deviantart images mistakenly choosing preview image. 2018-11-29 23:01:08 -06:00
Albert Yi
60cee5f452
Merge pull request #3989 from evazion/fix-3987
Wiki pages: convert other_names column to array (#3987)
2018-11-19 16:23:32 -08:00
evazion
d82418ed43 Fix #3988: ordpool:<name> fails for large pools.
Also fixes ordpool:<name> not returning all posts in the correct order
when searching for series pools that contain duplicate posts.
2018-11-16 22:48:17 -06:00
evazion
41ff05c121 artists: convert other_names to array (#3987). 2018-11-15 14:31:16 -06:00
Albert Yi
0508b127fd continue refactoring savedsearch 2018-11-15 12:06:13 -08:00
evazion
741462ae68 artist versions: convert other_names, url_string to arrays (#3987). 2018-11-14 14:25:02 -06:00
evazion
fe2698a011 tag implications: convert descendant_names to array (#3987). 2018-11-14 12:51:18 -06:00
evazion
308a5021b4 wiki pages: convert other_names to array (#3987). 2018-11-13 19:18:11 -06:00
evazion
bea8c2a4b8 nijie: fix failure to handle certain image urls.
Fix IMAGE_URL regex not matching urls of this form:

* https://pic04.nijie.info/nijie_picture/diff/main/287736_161475_20181112032855_1.png

This caused the illust id to not be parsed from the url, which led to `#image_url`
returning nil, which led to uploads failing because the url to download was missing.
2018-11-12 18:04:07 -06:00
evazion
8f6c710c6b tests: fix translated tags test failures. 2018-11-12 18:04:07 -06:00
evazion
7524d52276 Fix #3985: Uploads: 405 Method Not Allowed. 2018-11-11 20:18:21 -06:00
evazion
6a7cd6ce8e Fix #3984: Twitter: undefined method `first' for nil:NilClass.
Fix Sources::Strategies::Twitter#image_urls to return an empty array
instead of nil when the tweet doesn't contain any images.
2018-11-11 17:41:32 -06:00
evazion
eade33fa7c Fix #3981: Inconsistency between posts and pools. 2018-11-10 12:37:08 -06:00
evazion
115ed16a96 pools: store post_ids as array instead of string (fix #3979) 2018-11-08 15:09:31 -06:00
evazion
1281481548 Fix #3978: Pool name/category validations not being enforced. 2018-11-07 16:10:16 -06:00
evazion
29b6121a07 pools: refactor #neighbors + fix broken #neighbors tests. 2018-11-04 19:40:57 -06:00
evazion
5cf6a43918 sources: fix sources sometimes choosing wrong strategy (fix #3968)
Fix sources choosing the wrong strategy when the referer belongs to a
different site (for example, when uploading a twitter post with a pixiv
referer).

* Fix `match?` to only consider the main url, not the referer.

* Change `match?` to match against a list of domains given by the `domains` method.

* Change `match?` to an instance method.
2018-11-04 13:00:17 -06:00
evazion
f5012464ab Fix #3965: Extraneous API attributes.
Remove the updater_id/updater_ip_addr virtual attributes from
pools/notes. Juss pass them in as params to create_version instead.
2018-10-30 15:41:17 -05:00
Albert Yi
5a13d06501 rescue failed network calls on artist test 2018-10-25 13:47:16 -07:00
Albert Yi
65a3e53667 eliminate extraneous assertion 2018-10-25 11:03:59 -07:00
Albert Yi
7d0b32d489 fix reltagquery test 2018-10-25 11:02:07 -07:00
Albert Yi
120a3d6402 fix post test 2018-10-24 17:35:01 -07:00
Albert Yi
9899199f33 eliminate weeklymaintenance file 2018-10-23 17:50:28 -07:00
Albert Yi
2aabaf56d8
Merge pull request #3951 from evazion/fix-maintenance-logging
Improve daily maintenance error handling
2018-10-15 14:20:44 -07:00
evazion
e329764276 Fix #3952: Adding animated_gif tag to a ugoira post breaks the player. 2018-10-10 23:50:36 -05:00
evazion
5201954413 maintenance: consolidate maintenance tasks in logical/maintenance.rb. 2018-10-09 20:11:23 -05:00
evazion
53a51310a3 tumblr: add canonical url tests (#3385). 2018-10-09 12:55:48 -05:00
evazion
16b1b72da5 tumblr: fix video urls not being recognized. 2018-10-09 12:44:59 -05:00
evazion
184a5ebf3e tumblr: fix _640 images not being recognized (#3944).
Fixes _640 images not being matched by the IMAGE regex and therefore not
being rewritten to the largest size.
2018-10-09 12:44:59 -05:00
evazion
d874c68419 tumblr: fix image_urls when api data is unavailable. 2018-10-09 12:44:59 -05:00
evazion
b0d7d90103 tumblr: extract info from url when api data is unavailable.
Derive the artist name / profile url / page url from the source URLs when
the API response is unavailable because the Tumblr post was deleted.

This fixes the artist finder to work on bad_tumblr_id posts.
2018-10-09 12:44:59 -05:00
evazion
0c31a5d6a9 tumblr: don't fail when api data is unavailable (#3948).
The api data is unavailable when the work is deleted (bad_tumblr_id), or
when the source is a direct image url with no page referer.
2018-10-09 12:44:59 -05:00
evazion
4c55c809b0 tumblr: don't fail when api key isn't configured. 2018-10-09 12:44:59 -05:00
evazion
c8d538f618 moebooru: delegate to substrategy based on post source (#3911).
If the yande.re or konachan.com post has a source from a supported site,
for example Pixiv or Twitter, then delegate the artist and commentary
lookup to that substrategy.

Only do this for sources from recognized sites, not the null strategy.
2018-10-06 14:27:49 -05:00
evazion
e5a4193dd4 moebooru: support batch bookmarklet previews (#3911). 2018-10-06 00:58:22 -05:00
evazion
fdb6e4ecee moebooru: rewrite konachan urls for Post#normalized_source (#3911). 2018-10-06 00:58:22 -05:00
evazion
864349dc7b moebooru: fetch tags (#3911). 2018-10-06 00:58:22 -05:00
evazion
9301bf2f11 tests: fix post expungement test.
Delay jobs so the uploaded file isn't deleted immediately (see f6c928e660).
2018-10-06 00:58:22 -05:00
evazion
bb5f291112 artists: don't create new version when nothing changed.
Fix an issue where saving an artist entry without changing anything
would create a new artist version.
2018-10-04 20:01:38 -05:00
evazion
03cc3dfa50 artists: fix editing invalid urls in artist entries (fix #3720, #3927, #3781)
Convert to an autosave association on urls. This ensures that when we
save the artist we only validate the added urls, not bad urls that we're
trying to remove, and that url validation errors are propagated up to
the artist object.

This also fixes invalid urls being saved in the artist history despite
validation failing (#3720).
2018-10-04 19:49:16 -05:00
evazion
bd3fb7d70e Post#normalized_source: fix for yande.re urls.
Fix regex for yande.re urls like this:

    https://files.yande.re/image/b66909b940e8d77accab7c9b25aa4dc3/yande.re%20377828.png
2018-10-01 20:03:21 -05:00
evazion
0c5452cdc3 Fix #3937: Blank lines in tagbox if certain taggroups are absent 2018-10-01 19:47:39 -05:00
evazion
2ae7ec42df Post#fast_count: raise min cache lifetime to 3 minutes (#3925). 2018-10-01 10:38:15 -05:00
evazion
4425150298 Post#fast_count: fix cache expiry not being set (#3925). 2018-10-01 10:38:15 -05:00