diff --git a/ruby/lib/jam_ruby/jam_track_importer.rb b/ruby/lib/jam_ruby/jam_track_importer.rb index a68ef6cc2..a0b21938c 100644 --- a/ruby/lib/jam_ruby/jam_track_importer.rb +++ b/ruby/lib/jam_ruby/jam_track_importer.rb @@ -440,6 +440,10 @@ module JamRuby jam_track.sales_region = 'Worldwide' jam_track.recording_type = 'Cover' jam_track.description = "This is a JamTrack audio file for use exclusively with the JamKazam service. This JamTrack is a high quality cover of the #{jam_track.original_artist} song \"#{jam_track.name}\"." + jam_track.hfa_license_status = false + jam_track.alternative_license_status = false + jam_track.hfa_license_desired = true + jam_track.server_fixation_date = Time.now if is_tency_storage? jam_track.vendor_id = metadata[:id] diff --git a/ruby/lib/jam_ruby/models/jam_track_hfa_request.rb b/ruby/lib/jam_ruby/models/jam_track_hfa_request.rb index 31d9f59bf..ed402dc2c 100644 --- a/ruby/lib/jam_ruby/models/jam_track_hfa_request.rb +++ b/ruby/lib/jam_ruby/models/jam_track_hfa_request.rb @@ -11,7 +11,7 @@ module JamRuby # look through all jam_track requests, and find the highest one that is associated with an approved harry fox requests def self.find_max() - max = JamTrackHfaRequestId.select('max(request_id) as max').joins('INNER JOIN jam_track_hfa_requests ON jam_track_hfa_requests.id = jam_track_hfa_request_id').where('received_at IS NOT NULL').first()['max'] + max = JamTrackHfaRequestId.select('coalesce(max(request_id), 0) as max').joins('INNER JOIN jam_track_hfa_requests ON jam_track_hfa_requests.id = jam_track_hfa_request_id').where('received_at IS NOT NULL').first()['max'] max.to_i end @@ -35,7 +35,7 @@ module JamRuby request_id.jam_track = jam_track request_id.jam_track_hfa_request = request request_id.request_id = start - start += start + 1 + start += 1 request_id.save request_id.reload # to get back the request_id attribute requests << request_id