From 1cdf75281e474b80e8e1a23e4168d3284a289d51 Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Wed, 5 Oct 2011 15:27:45 +0400 Subject: [PATCH] Fixing zero length tracks --- app/models/music/album.rb | 2 +- app/views/artist/_page.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/music/album.rb b/app/models/music/album.rb index 7683886..45bbedc 100644 --- a/app/models/music/album.rb +++ b/app/models/music/album.rb @@ -1,6 +1,6 @@ class Album < ActiveRecord::Base belongs_to :artist - has_many :tracks, :conditions => ['length > 0'], :order => 'bonus ASC, position ASC', :dependent => :destroy + has_many :tracks, :conditions => ['position > 0'], :order => 'bonus ASC, position ASC', :dependent => :destroy has_many :album_formats has_many :release_formats, :through => :album_formats diff --git a/app/views/artist/_page.html.haml b/app/views/artist/_page.html.haml index 30ff5a2..e23455d 100644 --- a/app/views/artist/_page.html.haml +++ b/app/views/artist/_page.html.haml @@ -28,5 +28,5 @@ %tr %td.song-title= track[:name] %td.song-duration - .s-duration= track[:duration] + .s-duration= (track[:duration] unless track[:duration] == '0:00') .s-add{ :data_id => track[:id] }= I18n.t 'player.add_one' \ No newline at end of file