1
0
Fork 0
oldhaven/app/controllers/track_controller.rb

15 lines
451 B
Ruby
Raw Normal View History

class TrackController < ApplicationController
2011-04-08 19:42:14 +00:00
require 'net/http'
require 'uri'
def listen
2011-04-10 03:17:34 +00:00
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
2011-04-08 19:42:14 +00:00
2011-04-11 03:12:06 +00:00
url = Vkontakte.get(artist.name, track.name, (track.length / 1000).round)
2011-04-10 00:15:29 +00:00
2011-04-11 04:16:00 +00:00
redirect_to url
end
end