added 'lib' to autoload_once_paths, changed folder and file names in LastFM library/module
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
require 'uri'
|
||||
|
||||
class ArtistsController < ApplicationController
|
||||
|
||||
def index
|
||||
@albums = LastFM::Artist.getTopAlbums "Avril Lavigne", 20
|
||||
puts @albums
|
||||
end
|
||||
|
||||
def show
|
||||
@artist = LastFM::Artist.getInfo CGI.unescape(params[:id])
|
||||
@tracks = LastFM::Artist.getTopTracks @artist.name, 10
|
||||
@albums = LastFM::Artist.getTopAlbums @artist.name, 8
|
||||
@images = LastFM::Artist.getImages @artist.name, 18
|
||||
@related= LastFM::Artist.getSimilar @artist.name, 6
|
||||
end
|
||||
|
||||
def index
|
||||
@albums = LastFM::Artist.getTopAlbums "Avril Lavigne", 20
|
||||
puts @albums
|
||||
#puts @albums.to_yaml
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
- @albums.album.each do |album|
|
||||
@@ -13,7 +13,7 @@ module Nineminutes
|
||||
# -- all .rb files in that directory are automatically loaded.
|
||||
|
||||
# Custom directories with classes and modules you want to be autoloadable.
|
||||
config.autoload_paths += %W(#{config.root}/lib)
|
||||
config.autoload_once_paths += %W(#{config.root}/lib)
|
||||
# config.autoload_paths += Dir["#{config.root}/lib/LastFM/"]
|
||||
# config.autoload_paths << config.root.join('lib')
|
||||
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
require 'LastFM/LastFMRequest'
|
||||
require 'LastFM/Artist'
|
||||
require 'LastFM/Album'
|
||||
require 'LastFM/Track'
|
||||
require 'LastFM/Chart'
|
||||
|
||||
LastFM::LastFMRequest::api_key = '4c32e360f68553ec8fdca3711456b4f9'
|
||||
@@ -10,7 +10,7 @@ module LastFM
|
||||
base_uri "ws.audioscrobbler.com/2.0/"
|
||||
parser Proc.new { |data| Hashie::Mash.new(ActiveSupport::JSON.decode(data)) }
|
||||
default_params :format => 'json', :autocorrect => '1'
|
||||
debug_output $>
|
||||
#debug_output $>
|
||||
format :json
|
||||
|
||||
def self.api_key=(key)
|
||||
Reference in New Issue
Block a user