diff --git a/app/controllers/import_controller.rb b/app/controllers/import_controller.rb index 83af8c0..9de72c7 100644 --- a/app/controllers/import_controller.rb +++ b/app/controllers/import_controller.rb @@ -54,7 +54,7 @@ class ImportController < ApplicationController end end - unless releases_mb.empty? or true + unless releases_mb.empty? # Sorting releases by date releases_mb.sort! { |a, b| a['date'].to_date <=> b['date'].to_date } @@ -128,7 +128,7 @@ class ImportController < ApplicationController tracks_mb.each do |mb_track| unless ['[silence]', '[untitled]'].include? mb_track['recording']['title'] track = Track.new - track.name = mb_track['recording']['title'] + track.name = mb_track['recording']['title'].gsub(/\s\\\s\[.*?\]/, '') track.album_id = album.id track.position = mb_track['position'] track.length = mb_track['length'] unless mb_track['length'].nil? diff --git a/public/js/beathaven/search.js b/public/js/beathaven/search.js index 3f82893..566db7c 100644 --- a/public/js/beathaven/search.js +++ b/public/js/beathaven/search.js @@ -6,7 +6,7 @@ var Search = { $('#search-container input').attr('disabled', 'disabled').blur(); $('#search-container img').show(); $('.autocomplete-container').hide(); - $('.artist_loading').hide(); + $('.artist_loading.failed').hide(); Search.hideSuggestions(); }, @@ -48,6 +48,7 @@ var Search = { }, showError: function() { + $('.artist_loading.ok, .artist_pics').hide(); $('.artist_loading.failed').show(); } }