Import fixes
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user