Commit Graph

32 Commits

Author SHA1 Message Date
nonamethanks
c9227645d9 Add anifty.jp support 2022-04-18 16:50:26 +02:00
evazion
0d480eb832 artist urls: stop using normalized_url.
Stop the last remaining uses of the `artist_urls.normalized_url` column.
It's already no longer used by the artist finder. The only remaining
uses were by API users. Those users should use the `url` column instead.
2022-04-02 23:58:01 -05:00
evazion
231075fb49 artists: fix artist finder to return nothing if it finds too many duplicates 2022-03-26 15:08:55 -05:00
evazion
c51d1a6f5e artists: add more sites to artist finder blacklist. 2022-03-23 02:30:52 -05:00
evazion
1e6e519709 artists: add more sites to artist finder blacklist. 2022-03-22 04:27:46 -05:00
NamelessContributor
038c767455 artists: add naver.com to artist finder blacklist. 2022-03-21 17:34:44 +01:00
evazion
705edfb175 artists: add more patterns to artist finder blacklist. 2022-03-20 21:27:38 -05:00
evazion
03d2098d6d artists: fix artist finder returning wrong results when given nil url.
Fix the artist finder returning incorrect results when given a nil URL.
This only happened when an artist with a URL like this existed:

    http:///blog.naver.com/dan_rak

Note the triple `///`; the extra `/` messed up the artist finder.

The artist finder may be given a nil URL when a source strategy returns
a nil profile URL, usually because the source is bad_id.
2022-03-18 06:01:36 -05:00
evazion
c64df46de4 artists: make artist finder use url instead of normalized_url.
Make the artist finder search for artists using the `url` field instead
of the `normalized_url` field. This lets us get rid of `normalized_url`
in the future.

As described in 10dac3ee5, artist URLs have both a `url` column and a
`normalized_url` column. The `normalized_url` column was the one used
for artist finding. The `url` was secretly normalized behind the scenes
so that artist finding would work no matter how the URL was written in
the artist entry. This is no longer necessary now that URLs are directly
normalized in artist entries.

This fixes various cases where artist finding didn't work for non-obvious
reasons, usually because the URL wasn't written in the right format so
it wasn't properly normalized behind the scenes.

This also makes it so that artist finding is case-insensitive, which
fixes #4821. Hopefully no sites are perverse enough to allow two
different usernames that differ only in case.

Users running their own Danbooru instance may have to fix the URLs in
their artist entries for artist finding to work again. There are a few
fix scripts to help with this:

* script/fixes/104_normalize_weibo_artist_urls.rb
* script/fixes/105_normalize_pixiv_artist_urls.rb
* script/fixes/106_normalize_artist_urls.rb
2022-03-18 04:00:16 -05:00
evazion
be9ef0c49f artists: add m.weibo.cn urls to artist finder blacklist. 2022-03-13 03:54:17 -05:00
nonamethanks
a6549bc6fe Add Fantia support
Also fixes a regression in 74fdeef10c
that stopped mastodon urls from being given the right priority.
2022-03-10 17:43:32 +01:00
evazion
60a26af6e3 rails: add 'URL' inflection.
Make it so we can write `ArtistURL` instead of `ArtistUrl`.
2022-02-22 00:17:53 -06:00
evazion
21c0d55aa4 Fix #5002: "Urls url has already been taken" when submitting duplicate urls with different capitalization
Fix URLs being normalized after checking for duplicates rather than
before, which meant that URLs that differed in capitalization weren't
detected as duplicates.
2022-02-08 19:15:55 -06:00
evazion
a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00
evazion
8669edd93f artists: add mega.nz to artist finder blacklist. 2021-12-07 04:12:52 -06:00
nonamethanks
043f2fb124 Add Foundation support 2021-11-01 01:39:56 +01:00
nonamethanks
16f76fe396 Update artist finder blacklist 2021-09-24 14:50:19 +02:00
evazion
ed302fdf4d docs: add documentation for various classes in app/logical. 2021-06-23 06:23:29 -05:00
nonamethanks
0cae2e75b9 Artist finder: add skeb.jp root to blacklist 2021-03-14 04:13:55 +01:00
evazion
ed7e7b1d30 Merge pull request #4639 from nonamethanks/fix_pixiv_en_links
Update artist finder blacklist
2021-01-04 01:15:15 -06:00
evazion
09e3146819 artist finder: add blog.livedoor.jp to blacklist. 2020-12-19 00:51:34 -06:00
nonamethanks
25682ebf46 Blacklist baraag.net root from artist finder 2020-12-16 13:43:50 +01:00
nonamethanks
6b966689b0 Blacklist pixiv en urls from artist finder 2020-12-16 13:42:25 +01:00
evazion
92b6204a77 Merge pull request #4630 from nonamethanks/fix_fc2
Fix blog.fc2 urls matching wrong artists
2020-12-05 12:53:51 -06:00
nonamethanks
32f4cb1236 Fix blog.fc2 urls matching wrong artists 2020-12-04 00:17:02 +01:00
evazion
49c15e1de7 artists: blacklist reddit.com from artist finder. 2020-08-20 20:09:07 -05:00
evazion
42c06b0f1e Merge pull request #4516 from nonamethanks/add_newgrounds_support
Add NewGrounds support
2020-06-24 00:20:16 -05:00
nonamethanks
7a41ee9c34 Add NewGrounds support 2020-06-18 03:22:30 +02:00
evazion
b551e3634f Fix misc rubocop warnings. 2020-06-16 21:36:15 -05:00
evazion
88d9fc4e5e sources: simplify artist finder url normalization.
Get rid of `normalized_for_artist_finder?` and `normalizable_for_artist_finder?`.
This was legacy bullshit that was originally designed to avoid API calls
when saving artist entries containing old Pixiv direct image urls that
had already been normalized, or that couldn't be normalized because they
were bad id.

Nowadays we store profile urls in artist entries instead of direct image
urls, so we don't normally need to do any API calls to normalize the
profile url. Strategies should take care to avoid triggering API calls
inside `profile_url` when possible.
2020-05-29 15:35:15 -05:00
nonamethanks
5c7307a1c9 Add Weibo support 2020-05-27 11:30:05 +02:00
evazion
ddffffb413 artists: factor out artist finder to separate module. 2020-03-06 23:23:38 -06:00