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.
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.
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.
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).
Allow searching the URL field by regex or by wildcard.
If the query looks like `/twitter/` do a regex search, otherwise if it
looks like `http://www.twitter.com/*` do a wildcard search, otherwise if
it looks like an url do an artist finder search, lastly if it looks like
`twitter` do a `*twitter*` search.
Add these search params:
* /artists?search[<field>]=
* /artists?search[<field>_eq]=
* /artists?search[<field>_not_eq]=
* /artists?search[<field>_like]=
* /artists?search[<field>_not_like]=
* /artists?search[<field>_ilike]=
* /artists?search[<field>_not_ilike]=
* /artists?search[<field>_regex]=
* /artists?search[<field>_not_regex]=
where `<field>` can be `name`, `group_name`, or `other_names`.
Remove these search params:
* /artists?search[name_matches]=
* /artists?search[other_names_match]=
* /artists?search[group_name_matches]=
`/artists?search[<field>_like]=` effectively does the same thing that
these searches did.
Drop support for the following pseudo-metatags in the Name field in the
artists search form:
* name:<name>
* other:<other name>
* group:<group name>
* status:banned
* status:active
* http://www.example.com
Instead, make the Name field do a wildcard search against the artist
name, group name, or other names. If the query looks like `/regex/`,
then do a regex search against any of these names.
/artists?search[name] now does a literal exact match and
/artists?search{any_name_matches] does the above wildcard/regex search.
* Move the limit:<n> / order:random metatag parsing from the controller
to the post set.
* Introduce `Tag.has_metatag?` and use it to parse these metatags
instead of using a regex (#2894).
Fixes the banned IP check not being applied when sending the HEAD
request for is_cloudflare?.
Also fixes the `#size` method not using the uncached url (which meant
the bookmarklet could report the wrong filesize on artstation uploads).