Player functionality restored
This commit is contained in:
@@ -90,19 +90,18 @@ class ArtistController < ApplicationController
|
||||
@artist[:albums] = []
|
||||
artist.albums.each do |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 = []
|
||||
tmp_album = {:id => album.id, :name => album.name, :year => album.year, :pic => album.pic_url, :tracks => []}
|
||||
album.tracks.each do |track|
|
||||
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.to_s 36
|
||||
# tmp_track[:mbid] = track.mbid
|
||||
(track.bonus == 0 ? album_tracks : bonus_tracks) << tmp_track
|
||||
# (track.bonus == 0 ? album_tracks : bonus_tracks) << tmp_track
|
||||
tmp_album[:tracks] << tmp_track
|
||||
end
|
||||
tmp_album[:tracks] = {album: album_tracks, bonus: bonus_tracks}
|
||||
@artist[:albums] << tmp_album if (album_tracks+bonus_tracks).length > 0
|
||||
# tmp_album[:tracks] = {album: album_tracks, bonus: bonus_tracks}
|
||||
@artist[:albums] << tmp_album unless tmp_album[:tracks].empty?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user