Method: Plllayer#sort

Defined in:
lib/plllayer.rb

#sort(&by) ⇒ Object

Sorts the playlist. Delegates to Array#sort, so a block may be passed to specify what the tracks should be sorted by.

This method is safe to call while the playlist is playing.



376
377
378
379
380
381
382
383
# File 'lib/plllayer.rb', line 376

def sort(&by)
  current_track = track
  @playlist.sort! &by
  if playing?
    @index = @playlist.index(current_track)
  end
  true
end