Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mackstann committed Jan 3, 2009
1 parent 9670163 commit 7bed826
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mpris-remote
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ NOTES:
import os, sys, re, urllib2, dbus

# returns first matching player
def get_player(player):
regex = re.compile('org\.mpris\.(.%s)' % player)
def get_player():
regex = re.compile('^org\.mpris\.([^.]+)$')
for name in bus.list_names():
if regex.match(name):
return regex.match(name).group(1)
Expand All @@ -85,7 +85,7 @@ bus = dbus.SessionBus()
player = os.environ.get('MPRIS_REMOTE_PLAYER', '*')

if player == '*':
player = get_player(player)
player = get_player()

root_obj = bus.get_object('org.mpris.%s' % player, '/')
player_obj = bus.get_object('org.mpris.%s' % player, '/Player')
Expand Down

0 comments on commit 7bed826

Please sign in to comment.