Artist wipe, local brainz
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace :artist do
|
||||
desc 'Empty artist database'
|
||||
task :wipe => :environment do
|
||||
Album.destroy_all
|
||||
ArtistLink.destroy_all
|
||||
end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ namespace :lastfm do
|
||||
ImportController.parseLastfmXML('tmp/data/top1000.xml').each do |artist|
|
||||
puts artist[:name] + (artist[:mbid].empty? ? '' : ' (' + artist[:mbid] + ')')
|
||||
record = Artist.find_or_create_by_name(artist[:name])
|
||||
record.mbid = artist[:mbid]
|
||||
# record.mbid = artist[:mbid]
|
||||
record.save
|
||||
res = ImportController.importArtist(artist[:name])
|
||||
if res == 1
|
||||
@@ -22,7 +22,7 @@ namespace :lastfm do
|
||||
ImportController.parseLastfmXML('tmp/data/hyped500.xml').each do |artist|
|
||||
puts artist[:name] + (artist[:mbid].empty? ? '' : ' (' + artist[:mbid] + ')')
|
||||
record = Artist.find_or_create_by_name(artist[:name])
|
||||
record.mbid = artist[:mbid]
|
||||
# record.mbid = artist[:mbid]
|
||||
record.save
|
||||
res = ImportController.importArtist(artist[:name])
|
||||
if res == 1
|
||||
|
||||
Reference in New Issue
Block a user