Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #16 from jondye/new_commands
Browse files Browse the repository at this point in the history
Add loadalbum and addalbum commands
  • Loading branch information
jinglemansweep authored Jul 20, 2017
2 parents 5135749 + 47694c6 commit e2313fe
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pylms/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,32 @@ def playlist_erase(self, index):
"""Erase Item From Playlist"""
self.request("playlist delete %i" % (index))

def playlist_loadalbum(self, genre=None, artist=None, album=None):
"""Add an album to the Playlist"""
if genre is None:
genre = '*'
genre = self.__quote(genre)
if artist is None:
artist = '*'
artist = self.__quote(artist)
if album is None:
album = '*'
album = self.__quote(album)
self.request("playlist loadalbum %s %s %s" % (genre, artist, album))

def playlist_addalbum(self, genre=None, artist=None, album=None):
"""Add an album to the Playlist"""
if genre is None:
genre = '*'
genre = self.__quote(genre)
if artist is None:
artist = '*'
artist = self.__quote(artist)
if album is None:
album = '*'
album = self.__quote(album)
self.request("playlist addalbum %s %s %s" % (genre, artist, album))

def playlist_track_count(self):
"""Get the amount of tracks in the current playlist"""
return int(self.request('playlist tracks ?'))
Expand Down

0 comments on commit e2313fe

Please sign in to comment.