1
0
Fork 0
This commit is contained in:
Gregory Eremin 2011-10-20 15:20:19 +04:00
parent 7ec4071652
commit 3b97c12c70
1 changed files with 3 additions and 5 deletions

View File

@ -20,10 +20,8 @@ class ArtistController < ApplicationController
best_match = results[0][:name]
if best_match != artist_name and similar_names(artist_name, best_match)
return render json: { status: 'corrected', correct_name: best_match }
elsif results[0][:name] == artist_name
elsif best_match == artist_name
queue_loading(artist_name, results[0][:mbid])
@artist = { artist: @artist, albums: [] }
@loading = true
return render json: { status: 'loading', html: render_compact_partial(:page) }
else
@suggestions = results.take(5)
@ -39,8 +37,8 @@ class ArtistController < ApplicationController
render json: {
status: @artist.status_str,
artist: @artist,
html: render_compact_partial(:page) }, include: {albums: {include: {tracks: {}}}
}
html: render_compact_partial(:page)
}, include: {albums: {include: {tracks: {}}}}
end
private