14 lines
431 B
Ruby
14 lines
431 B
Ruby
class TrackController < ApplicationController
|
|
require 'net/http'
|
|
require 'uri'
|
|
def listen
|
|
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
|
|
|
|
url = Vkontakte.get(artist.name, track.name, (track.length / 1000).round)
|
|
|
|
end
|
|
end
|