Bonus tracks, user preferred media types
This commit is contained in:
@@ -2,7 +2,7 @@ require 'open-uri'
|
||||
require 'musicbrainz'
|
||||
|
||||
class ArtistController < ApplicationController
|
||||
@@default_album_types = ['Album', 'Soundtrack']
|
||||
@@default_album_types = [:album, :soundtrack]
|
||||
def data
|
||||
@data = {
|
||||
:status => '',
|
||||
@@ -81,9 +81,15 @@ class ArtistController < ApplicationController
|
||||
pic: artist.pic_url
|
||||
}
|
||||
|
||||
media_types = @@default_album_types
|
||||
session = Session.find_by_key(session_key)
|
||||
unless session.nil?
|
||||
media_types = session.user.music
|
||||
end
|
||||
|
||||
@artist[:albums] = []
|
||||
artist.albums.each do |album|
|
||||
if @@default_album_types.include? album.album_type and album.status == 1
|
||||
if 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 = []
|
||||
|
||||
Reference in New Issue
Block a user