Skip to content

Commit 9486714

Browse files
authored
Merge pull request eonpatapon#130 from kastdeur/master
Allow Host to contain a '~' in the configuration
2 parents 491588a + 1f9c190 commit 9486714

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mpDris2.in.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,8 @@ def usage(params):
14261426
if '@' in params['host']:
14271427
params['password'], params['host'] = params['host'].rsplit('@', 1)
14281428

1429+
params['host'] = os.path.expanduser(params['host'])
1430+
14291431
for p in ['mmkeys', 'notify']:
14301432
if config.has_option('Bling', p):
14311433
params[p] = config.getboolean('Bling', p)
@@ -1446,6 +1448,7 @@ def usage(params):
14461448
if not re.match('^[0-9A-Za-z+.-]+://', music_dir):
14471449
music_dir = 'file://' + music_dir
14481450
if music_dir.startswith('file://'):
1451+
music_dir = music_dir[:7] + os.path.expanduser(music_dir[7:])
14491452
if not os.path.exists(music_dir[7:]):
14501453
logger.error('Music library path %s does not exist!' % music_dir)
14511454
# Non-local URLs can still be useful to MPRIS clients, so accept them.

0 commit comments

Comments
 (0)