From 273317ea90b2b2c52e93cecff8a8ab5a106ca6e6 Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Mon, 26 Sep 2011 06:41:04 +0400 Subject: [PATCH] Work on layout --- app/controllers/artist_controller.rb | 11 ++++++----- app/controllers/last_fm_controller.rb | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/artist_controller.rb b/app/controllers/artist_controller.rb index f9a7cb1..ecc8c29 100644 --- a/app/controllers/artist_controller.rb +++ b/app/controllers/artist_controller.rb @@ -88,8 +88,9 @@ class ArtistController < ApplicationController end @artist[:albums] = [] - artist.albums.each do |album| - if media_types.include? album.album_type.downcase.to_sym and album.status == 1 + artist.albums.with_format(:album).each do |album| + ap album + if true # media_types.include? album.album_type.downcase.to_sym and album.status == 1 tmp_album = {id: album.id, name: album.name, year: album.year, pic: album.pic_url} album_tracks = [] bonus_tracks = [] @@ -97,8 +98,8 @@ class ArtistController < ApplicationController tmp_track = {id: track.id, name: track.name, live: track.live, acoustic: track.acoustic} tmp_track[:length] = (track.length / 1000).round unless track.length.nil? tmp_track[:duration] = formatTrackDuration(track.length) - tmp_track[:position] = track.position - tmp_track[:mbid] = track.mbid + tmp_track[:position] = track.position.to_s 36 + # tmp_track[:mbid] = track.mbid (track.bonus == 0 ? album_tracks : bonus_tracks) << tmp_track end tmp_album[:tracks] = {album: album_tracks, bonus: bonus_tracks} @@ -111,7 +112,7 @@ class ArtistController < ApplicationController def formatTrackDuration length if length - time = (length / 1000).round + time = length # (length / 1000).round time_m = (time / 60).floor time_s = time - time_m * 60 time_m.to_s + ':' + (time_s < 10 ? '0' : '') + time_s.to_s diff --git a/app/controllers/last_fm_controller.rb b/app/controllers/last_fm_controller.rb index 9ed4d6a..5f89a16 100644 --- a/app/controllers/last_fm_controller.rb +++ b/app/controllers/last_fm_controller.rb @@ -60,7 +60,7 @@ class LastFmController < ApplicationController :artist => params[:artist], :album => params[:album], :trackNumber => params[:position], - :mbid => params[:mbid], + # :mbid => params[:mbid], :duration => params[:length], :sk => user.lastfm_key # Auth session key ) @@ -89,7 +89,7 @@ class LastFmController < ApplicationController :artist => params[:artist], :album => params[:album], :trackNumber => params[:position], - :mbid => params[:mbid], + # :mbid => params[:mbid], :duration => params[:length], :sk => user.lastfm_key # Auth session key )