From 890c3a474327f9b04f7f86a6ecb4d04a43725a84 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 10 Oct 2013 10:36:26 +0000 Subject: tracklist: fix off-by-one when adding track Otherwise we end up going past the end of the list. --- lib/dtas/tracklist.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dtas/tracklist.rb b/lib/dtas/tracklist.rb index b6f02c3..ef60915 100644 --- a/lib/dtas/tracklist.rb +++ b/lib/dtas/tracklist.rb @@ -94,7 +94,7 @@ class DTAS::Tracklist # :nodoc: if set_as_current @pos = idx + 1 else - @pos += 1 if @pos >= idx + @pos += 1 if @pos > idx end else # nil = first_track @list.unshift(track) -- cgit v1.2.3-24-ge0c7