-
Notifications
You must be signed in to change notification settings - Fork 75
Paperclip Walkthrough
tom statter edited this page Mar 18, 2018
·
1 revision
Given we have a Model Track with an associated Paperclip attachment called 'audio'
First lets create an empty template spreadsheet
bundle exec thor datashift:generate:excel -m Track -r db/seed/track_covers.xls
Remove id, created_at etc leave just title and audio_file
Now we get a listing of the MP3s we want to bulk upload
find /media/MusicMaking/MASTERS/ -name *.mp3
Copy and paste that into the audio_file column
Grab all the titles ... the exact specifics of the cuts will vary depending on the format you use to id your tracks
Mine just happens to be number.title_bpm_date so this grabs my titles
find /media/sf_Dropbox/MusicMaking/MASTERS/ -name *.mp3 | cut -d '.' -f 2 | cut -d '_' -f 1