From 63a567f7cecd430daa8db6feda6cbf311886f42f Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Thu, 24 Nov 2011 02:41:05 +0400 Subject: [PATCH] Original name --- app/controllers/import_controller.rb | 3 ++- app/views/artist/_page.html.haml | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/import_controller.rb b/app/controllers/import_controller.rb index a397a19..ee3d89b 100644 --- a/app/controllers/import_controller.rb +++ b/app/controllers/import_controller.rb @@ -38,8 +38,9 @@ class ImportController < ApplicationController artist.pic_url = lastfm_artist['artist']['image'][3]['#text'] artist.listeners = lastfm_artist['artist']['stats']['listeners'] artist.artist_type = brainz_artist.type + artist.original_name = brainz_artist.name artist.mbid = brainz_artist.id - artist.save + artist.save! brainz_artist.urls.each do |service, url| ArtistLink.new( diff --git a/app/views/artist/_page.html.haml b/app/views/artist/_page.html.haml index 9927955..4fdb96d 100644 --- a/app/views/artist/_page.html.haml +++ b/app/views/artist/_page.html.haml @@ -5,7 +5,9 @@ .span4.columns.pic = image_tag @artist.pic_url unless @artist.pic_url.nil? .span7.columns.desc - %h2= @artist.name + %h2 + =(@artist.original_name.nil? or @artist.original_name == @artist.name ? @artist.name : @artist.original_name) + %small= " "+(@artist.original_name.nil? or @artist.original_name == @artist.name ? "" : @artist.name) = @artist.desc.html_safe unless @artist.desc.nil? - unless @artist.artist_links.empty? .service-icons @@ -22,7 +24,9 @@ .button-container %a.btn.add-album{ :'data-album-id' => album.id }= I18n.t 'player.add' .span7.columns.tracks - %h3{ :'data-album-id' => album.id }= album.name + " (" + album.year.to_s + ")" + %h3{ :'data-album-id' => album.id } + = album.name + %small= " ("+album.year.to_s+")" %table.zebra-striped.tracklist - album.tracks.each do |track| %tr