Work on layout
This commit is contained in:
		
							parent
							
								
									26808f9b66
								
							
						
					
					
						commit
						273317ea90
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user