Merge branch 'master' of github.com:magnolia-fan/BeatHaven

This commit is contained in:
Gregory Eremin
2011-11-24 14:14:51 +04:00
36 changed files with 841 additions and 53 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class ArtistController < ApplicationController
if results.empty?
return render json: { status: 'not_found' }
end
best_match = results[0][:name]
best_match = results[0][:sort_name]
if best_match != artist_name and similar_names(artist_name, best_match)
return render json: { status: 'corrected', correct_name: best_match }
elsif best_match == artist_name
+2 -1
View File
@@ -38,8 +38,9 @@ class ImportController < ApplicationController
artist.pic_url = lastfm_artist['artist']['image'][3]['#text']
artist.listeners = lastfm_artist['artist']['stats']['listeners']
artist.artist_type = brainz_artist.type
artist.original_name = brainz_artist.name
artist.mbid = brainz_artist.id
artist.save
artist.save!
brainz_artist.urls.each do |service, url|
ArtistLink.new(
+1 -1
View File
@@ -18,7 +18,7 @@ class TrackController < ApplicationController
def report_unavailable
track = Track.find(params[:id])
unless track.nil? or track.available
track.available = true
track.available = false
track.save
return render :json => { :status => :success }
end