* another build

This commit is contained in:
Seth Call 2015-08-07 17:05:51 -05:00
parent 4288ebe0d0
commit ccec9abbc8
2 changed files with 23 additions and 5 deletions

View File

@ -184,9 +184,9 @@ module JamRuby
bits = ['audio']
# example: Sister Hazel - All For You - 10385
first_dash = metalocation.index('-')
first_dash = metalocation.index(' - ')
if first_dash
artist = metalocation[0...first_dash].strip
artist = metalocation[0...(first_dash)].strip
bits << artist
else
finish("invalid_metalocation", "metalocation not valid #{metalocation}")
@ -195,7 +195,7 @@ module JamRuby
last_dash = metalocation.rindex('-')
if last_dash
song = metalocation[(first_dash+1)...last_dash].strip
song = metalocation[(first_dash+3)...last_dash].strip
bits << song
else
finish("invalid_metalocation", "metalocation not valid #{metalocation}")
@ -1568,12 +1568,18 @@ module JamRuby
def synchronize_all(options)
importers = []
count = 0
iterate_song_storage do |metadata, metalocation|
next if metadata.nil? && is_tency_storage?
count+=1
importer = synchronize_from_meta(metalocation, options)
importers << importer
if count > 100
break
end
end
@ -1702,8 +1708,13 @@ module JamRuby
return nil
end
tency_data = @tency_metadata[song_id]
if tency_data.nil?
@@log.warn("missing tency metadata '#{song_id}'")
end
return tency_data
else
begin
@ -1748,6 +1759,9 @@ module JamRuby
meta = load_metalocation(metalocation)
if meta.nil? && is_tency_storage?
raise "no tency song matching this metalocation #{metalocation}"
end
jam_track_importer = nil
if jam_track
@@log.debug("jamtrack #{jam_track.name} located by metalocation")

View File

@ -23,11 +23,15 @@ namespace :jam_tracks do
path = ENV['TRACK_PATH']
if !path
puts "TRACK_PATH must be set to something like AD DC/Back in Black"
puts "TRACK_PATH must be set to something like audio/AC DC/Back in Black or mapped/50 Cent - In Da Club - 12401"
exit(1)
end
JamTrackImporter.synchronize_from_meta("audio/#{path}/meta.yml", skip_audio_upload:false)
if path.start_with?('mapped')
JamTrackImporter.storage_format = 'Tency'
end
JamTrackImporter.synchronize_from_meta("#{path}/meta.yml", skip_audio_upload:false)
end
task resync_audio: :environment do |task, args|