Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup artist finder #3889

Merged
merged 2 commits into from
Sep 12, 2018
Merged

Conversation

evazion
Copy link
Member

@evazion evazion commented Sep 12, 2018

This cleans up some things in the artist finding code. The main point of this is to replace the ajax call to /artists/finder.json with a call to /sources.js:

  • On posts, automatically trigger "Fetch source data" when clicking the Edit tab, instead of triggering the artist finder button. This way we find both the artist and the translated tags in one ajax call.

  • Remove the "Artist" finder button next to the source field. This button isn't necessary given that "Fetch source data" finds the artist itself.

  • Remove the /artists/finder.json API endpoint. This is no longer used after removing the "Artist" finder button.

  • Clean up the artist finding logic in Artist#url_matches such that we only lookup the url once, not multiple times.

* On posts, automatically trigger "Fetch source data" when clicking the
  Edit tab, instead of triggering the artist finder button. This way we
  find both the artist and the translated tags in one ajax call.

* Remove the "Artist" finder button next to the source field. This isn't
  necessary given that "Fetch source data" finds the artist itself.

* Remove the /artists/finder.json API endpoint. This is no longer used
  after removing the "Artist" finder button.
Rename Artist#find_all_by_url to url_matches and drop previous
url_matches method, along with find_artists and search_for_profile.

Previously find_artists tried to lookup the url, referer url, and profile
url in turn until an artist match was found. This was wasteful, because
the source strategy already knows which url to lookup (usually the profile
url). If that url doesn't find a match, then the artist doesn't exist.
@r888888888 r888888888 merged commit f487b2a into danbooru:master Sep 12, 2018
@evazion evazion deleted the fix-replace-artist-finder branch September 21, 2018 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants