eonpatapon / mpDris2

MPRIS V2.1 support for mpd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mpd connection should be read from environment, not hardcoded localhost

tidux opened this issue · comments

commented

The MPD_HOST environment variable exists so client programs like mpDris2 can connect to daemons running on something other than localhost:6600. I have some systems where mpd is bound to a specific non-localhost IPv4 or IPv6 address in order to enable network control, and mpDris2 can't connect to these systems without manually editing the script. This is suboptimal.

Reading MPD_HOST from environment (and config file, and command line) has been supported since 2011:

mpDris2/mpDris2

Lines 583 to 594 in c8a764a

if config.has_option('Connection', 'host'):
params['host'] = config.get('Connection', 'host')
if config.has_option('Connection', 'port'):
params['port'] = config.get('Connection', 'port')
if config.has_option('Connection', 'password'):
params['password'] = config.get('Connection', 'password')
if 'MPD_HOST' in os.environ:
params['host'] = os.environ['MPD_HOST']
if 'MPD_PORT' in os.environ:
params['port'] = os.environ['MPD_PORT']