diff --git a/app/controllers/artist_controller.rb b/app/controllers/artist_controller.rb index 368b5cd..21bc94c 100644 --- a/app/controllers/artist_controller.rb +++ b/app/controllers/artist_controller.rb @@ -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