VRFS-3936 jamtracks json send contents string, not a file proper; tweaking mobile.rake
This commit is contained in:
parent
91da29088f
commit
796ec60e1b
|
|
@ -78,10 +78,11 @@ class ApiSearchController < ApiController
|
|||
SampleApp::Application.load_tasks
|
||||
Rake::Task["mobile:jam_tracks_json"].invoke
|
||||
end
|
||||
render(file: fname)
|
||||
json = JSON.parse(File.read(fname))
|
||||
render(json: json, status: 200)
|
||||
|
||||
else
|
||||
render(json: {}, status: 200)
|
||||
render(json: {})
|
||||
end
|
||||
|
||||
elsif request.post?
|
||||
|
|
|
|||
|
|
@ -114,13 +114,18 @@ namespace :mobile do
|
|||
jtname = row[1]
|
||||
jt = JamTrack.
|
||||
where(name: jtname, original_artist: jtartist).
|
||||
includes([:genres, { jam_track_tracks: :instrument }]).
|
||||
limit(1).
|
||||
first
|
||||
next if jt.blank?
|
||||
|
||||
|
||||
jtdata = {
|
||||
artist: jtartist,
|
||||
genre: jt.genres.map(&:description).join(', '),
|
||||
instruments: jt.jam_track_tracks.map(&:instrument).compact.uniq.map(&:description).join(', '),
|
||||
language: jt.language,
|
||||
version: jt.version,
|
||||
price: jt.price,
|
||||
id: jt.id,
|
||||
key: jt.id,
|
||||
name: jtname,
|
||||
|
|
|
|||
Loading…
Reference in New Issue