#2404 fix artist finder
This commit is contained in:
@@ -253,8 +253,9 @@
|
|||||||
|
|
||||||
Danbooru.RelatedTag.find_artist = function(e) {
|
Danbooru.RelatedTag.find_artist = function(e) {
|
||||||
$("#artist-tags").html("<em>Loading...</em>");
|
$("#artist-tags").html("<em>Loading...</em>");
|
||||||
var url = $("#referer_url,#upload_source,#post_source");
|
var url = $("#upload_source,#post_source");
|
||||||
$.get("/artists/finder.json", {"url": url.val()}).success(Danbooru.RelatedTag.process_artist);
|
var referer_url = $("#referer_url");
|
||||||
|
$.get("/artists/finder.json", {"url": url.val(), "referer_url": referer_url.val()}).success(Danbooru.RelatedTag.process_artist);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ class ArtistsController < ApplicationController
|
|||||||
|
|
||||||
def finder
|
def finder
|
||||||
@artists = Artist.url_matches(params[:url]).order("id desc").limit(20)
|
@artists = Artist.url_matches(params[:url]).order("id desc").limit(20)
|
||||||
|
if @artists.empty? && params[:referer_url].present? && params[:referer_url] != params[:url]
|
||||||
|
@artists = Artist.url_matches(params[:referer_url]).order("id desc").limit(20)
|
||||||
|
end
|
||||||
respond_with(@artists) do |format|
|
respond_with(@artists) do |format|
|
||||||
format.xml do
|
format.xml do
|
||||||
render :xml => @artists.to_xml(:include => [:urls], :root => "artists")
|
render :xml => @artists.to_xml(:include => [:urls], :root => "artists")
|
||||||
|
|||||||
Reference in New Issue
Block a user