It fuckin' works\!
This commit is contained in:
@@ -2,12 +2,16 @@ class TrackController < ApplicationController
|
||||
require 'net/http'
|
||||
require 'uri'
|
||||
def listen
|
||||
artist = 'The White Stripes'
|
||||
track = 'Blue Orchid'
|
||||
length = 157
|
||||
pp track = Track.where(:id => params[:id].to_i).first
|
||||
pp release = Release.where(:id => track.release_id).first
|
||||
pp album = Album.where(:id => release.album_id).first
|
||||
pp artist = Artist.where(:id => album.artist_id).first
|
||||
|
||||
Vkontakte.get(artist, track, length)
|
||||
data = Vkontakte.get(artist.name, track.name, (track.length / 1000).round)
|
||||
#data = open('/Users/chez/Sites/beathaven/tmp/media.mp3').read
|
||||
#send_data data, :type=>"audio/mp3"
|
||||
|
||||
render :json => 0
|
||||
#render :text => data
|
||||
redirect_to data
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user