Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Commit

Permalink
Adding skip_length arg to next_prev method
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakjois committed Jan 12, 2010
1 parent 7026e3b commit 4012a86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/dhun/handler.rb
Expand Up @@ -43,11 +43,11 @@ def stop
end

def next(skip_length=1)
next_prev :next, 'queue'
next_prev :next, 'queue',skip_length
end

def prev(skip_length=1)
next_prev :prev, 'history'
next_prev :prev, 'history',skip_length
end

def shuffle
Expand Down Expand Up @@ -88,8 +88,8 @@ def perform_action(action, arg=nil, message={})
end

#next and previous method
def next_prev(action,message)
track = @player.send(action)
def next_prev(action,message,skip_length)
track = @player.send(action,skip_length)
return [:success, "Dhun is playing #{track}"] if track
return [:error, "Not enough tracks in #{message}"]
end
Expand Down

0 comments on commit 4012a86

Please sign in to comment.