lib/kagu/track.rb in kagu-3.0.6 vs lib/kagu/track.rb in kagu-3.0.7
- old
+ new
@@ -57,10 +57,11 @@
def artist=(value)
@artist = value.to_s.squish.presence
end
def bpm=(value)
- @bpm = value.to_s =~ /\A[0-9]+\z/ ? value.to_i : nil
+ value = value.to_s =~ /\A[0-9]+\z/ ? value.to_i : nil
+ @bpm = (value && value > 0) ? value : nil
end
def genre=(value)
@genre = value.to_s.squish.presence
end