From dc5f110844c3977963d4d384b54e5a3be2c43bc2 Mon Sep 17 00:00:00 2001 From: Carl Suster Date: Fri, 19 Apr 2019 17:27:52 +1000 Subject: [PATCH] mpdstats: use MPD_PORT env variable --- beetsplug/mpdstats.py | 2 +- docs/plugins/mpdstats.rst | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/beetsplug/mpdstats.py b/beetsplug/mpdstats.py index 876dcacdd..f232d87e9 100644 --- a/beetsplug/mpdstats.py +++ b/beetsplug/mpdstats.py @@ -326,7 +326,7 @@ class MPDStatsPlugin(plugins.BeetsPlugin): 'rating': True, 'rating_mix': 0.75, 'host': os.environ.get('MPD_HOST', u'localhost'), - 'port': 6600, + 'port': int(os.environ.get('MPD_PORT', 6600)), 'password': u'', }) mpd_config['password'].redact = True diff --git a/docs/plugins/mpdstats.rst b/docs/plugins/mpdstats.rst index 5472e7294..2e5e78c36 100644 --- a/docs/plugins/mpdstats.rst +++ b/docs/plugins/mpdstats.rst @@ -42,7 +42,8 @@ configuration file. The available options are: Default: The ``$MPD_HOST`` environment variable if set, falling back to ``localhost`` otherwise. - **port**: The MPD server port. - Default: 6600. + Default: The ``$MPD_PORT`` environment variable if set, + falling back to 6600 otherwise. - **password**: The MPD server password. Default: None. - **music_directory**: If your MPD library is at a different location from the