From bd3c5aa63949f2e394a4477dfea611dfd22121ae Mon Sep 17 00:00:00 2001 From: Sravanth C <54331348+chebro@users.noreply.github.com> Date: Wed, 28 Apr 2021 07:01:45 +0530 Subject: [PATCH] Feature: add password support to MPDClient --- bin/miniplayer | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/miniplayer b/bin/miniplayer index ce9d93b..0ee3c12 100755 --- a/bin/miniplayer +++ b/bin/miniplayer @@ -23,7 +23,8 @@ if "player" not in config.sections(): if "mpd" not in config.sections(): config["mpd"] = {"host": "localhost", - "port": "6600" + "port": "6600", + "pass": False } player_config = config["player"] @@ -45,6 +46,7 @@ MUSICDIR = os.path.expanduser(MUSICDIR) # MPD config MPDHOST = mpd_config.get("host", "localhost") MPDPORT = mpd_config.getint("port", 6600) +MPDPASS = mpd_config.get("pass", False) # What to use to draw images IMAGEMETHOD = player_config.get("image_method", "pixcat") @@ -86,6 +88,8 @@ class Player: # MPD init self.client = MPDClient() self.client.connect(MPDHOST, MPDPORT) + if MPDPASS: + self.client.password(MPDPASS) self.last_song = None