Commit Graph

1309 Commits

Author SHA1 Message Date
evazion
8408c0bf80 Fix #3815: Adjust notes positions/sizes after post replacement
Bug: Notes weren't rescaled when the 'final_source' field was given
during replacement.

The cause was that the notes were rescaled after the source was saved,
but saving the source clobbered `image_{width,height}_before_last_save`
inside `rescale_notes`.

Regressed in b0c2ddba.
2018-12-16 13:55:35 -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
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
a20eba9ef7 Fix #3983: Uploads: NoMethodError - undefined method `>=' for nil:NilClass
* Rename Upload#download_for_upload to #get_file_for_upload.

* Fix #get_file_for_upload to raise error if no file or source url was given.

* Fix javascript upload validation to disallow submitting form if file is
  not present and the source is not an url.
2018-11-11 17:12:39 -06:00
evazion
e10c6c6a30 Fix #3982: Uploads: URI::InvalidURIError - URI must be ascii only. 2018-11-11 12:17:58 -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
ed47db0e48 upload tags report: add controller test (#3975). 2018-11-06 18:29:27 -06:00
evazion
98cffc310b Fix pool elements controller tests. 2018-11-04 21:25:25 -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
e5f76b98ff switch upload service test to use raikou1 image 2018-10-25 12:57:54 -07:00
Albert Yi
19a84993ca fix video upload spec 2018-10-25 11:44:54 -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
12b88f7f97 fixes #3960 2018-10-17 15:37:47 -07:00
evazion
6148cb39a2 Fix nested blank search params not being stripped from searches.
From https://danbooru.donmai.us/forum_topics/9127?page=258#forum_post_151308:

    When you do a user search (from https://danbooru.donmai.us/users/search)
    the results only include those with someone in the inviter field.

The bug was that nested blank search params (/users?search[inviter][name_matches]=)
didn't get stripped from the search.
2018-10-17 16:11:44 -05: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