From 9963fd0432e379f163dcde2efa39a13689cff0e9 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 26 Aug 2016 10:58:32 -0300 Subject: [PATCH] mpdupdate: Support `$MPD_HOST` environment variable. This environment variable is also used by mpc. See http://linux.die.net/man/1/mpc for details. --- beetsplug/mpdupdate.py | 2 +- docs/plugins/mpdupdate.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/beetsplug/mpdupdate.py b/beetsplug/mpdupdate.py index 8ea1b5204..6c39375be 100644 --- a/beetsplug/mpdupdate.py +++ b/beetsplug/mpdupdate.py @@ -68,7 +68,7 @@ class MPDUpdatePlugin(BeetsPlugin): def __init__(self): super(MPDUpdatePlugin, self).__init__() config['mpd'].add({ - 'host': u'localhost', + 'host': os.environ.get('MPD_HOST', u'localhost'), 'port': 6600, 'password': u'', }) diff --git a/docs/plugins/mpdupdate.rst b/docs/plugins/mpdupdate.rst index 954a87b33..c846b917f 100644 --- a/docs/plugins/mpdupdate.rst +++ b/docs/plugins/mpdupdate.rst @@ -31,7 +31,7 @@ Configuration The available options under the ``mpd:`` section are: - **host**: The MPD server name. - Default: ``localhost``. + Default: The ``$MPD_HOST`` environment variable if set, falling back to ``localhost`` otherwise. - **port**: The MPD server port. Default: 6600. - **password**: The MPD server password.