Method: Muzak::Cmd#playlist_add_current

Defined in:
lib/muzak/cmd/playlist.rb

#playlist_add_current(pname) ⇒ Object

Add the currently playing song to the given playlist.

See Also:

muzak command:

  • playlist-add-current <playlist>

example invocation:

  • muzak> playlist-add-current favorites



70
71
72
73
74
75
76
77
# File 'lib/muzak/cmd/playlist.rb', line 70

def playlist_add_current(pname)
  if player.running?
    playlists[pname].add player.now_playing
    build_response
  else
    build_response error: "the player is not running"
  end
end