MPD Client¶
-
class
sima.mpdclient.
MPD
(config)[source]¶ Bases:
musicpd.MPDClient
Player instance inheriting from MPDClient (python-musicpd).
Some methods are overridden to format objects as
sima.lib.track.Track
for instance, other are calling parent class directly through super(). cf. MPD.__getattr__Note
find methods are looking for exact match of the object provided attributes in MPD music library
search methods are looking for exact match + fuzzy match.
-
find_tracks
(what)[source]¶ - Find tracks for a specific artist or album
>>> player.find_tracks(Artist('Nirvana')) >>> player.find_tracks(Album('In Utero', artist=Artist('Nirvana'))
-
monitor
()[source]¶ Monitor player for change Returns a list a events among:
database player media library has changed
playlist playlist modified
options player options changed: repeat mode, etc…
player player state changed: paused, stopped, skip track…
skipped current track skipped
-
property
playlist
¶ Override deprecated MPD playlist command
-
search_albums
(artist)[source]¶ Find potential albums for “artist”
Fetch all albums for “AlbumArtist” == artist → falls back to “Artist” == artist when no “AlbumArtist” tag is set
Tries to filter some mutli-artists album For instance an album by Artist_A may have a track by Artist_B. Then looking for albums for Artist_B wrongly returns this album.
-
property
state
¶ Returns (play|stop|pause)