Sitelet https://github.com/gpodder/gpodder/pull/1265/files
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions share/gpodder/extensions/mpris-listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def update(self, **kwargs):
('status' not in kwargs or kwargs['status'] == 'Playing') and not
subsecond_difference(cur['pos'], kwargs['pos'])):
logger.debug('notify Stopped: playback discontinuity:' +
'calc: %f observed: %f', cur['pos'], kwargs['pos'])
'calc: %r observed: %r', cur['pos'], kwargs['pos'])
self.notify_stop()

if ((kwargs['pos']) == 0 and
Expand Down Expand Up @@ -159,7 +159,7 @@ def update(self, **kwargs):
if self.status == 'Playing':
self.notify_playing()
else:
logger.debug('notify Stopped: status %s', self.status)
logger.debug('notify Stopped: status %r', self.status)
self.notify_stop()

def getinfo(self):
Expand Down Expand Up @@ -289,12 +289,20 @@ def on_seeked(self, position):
def query_position(self, sender):
proxy = self.bus.get_object(sender, self.PATH_MPRIS)
props = dbus.Interface(proxy, self.INTERFACE_PROPS)
return props.Get(self.INTERFACE_MPRIS, 'Position')
try:
pos = props.Get(self.INTERFACE_MPRIS, 'Position')
except:
pos = None
return pos

def query_status(self, sender):
proxy = self.bus.get_object(sender, self.PATH_MPRIS)
props = dbus.Interface(proxy, self.INTERFACE_PROPS)
return props.Get(self.INTERFACE_MPRIS, 'PlaybackStatus')
try:
status = props.Get(self.INTERFACE_MPRIS, 'PlaybackStatus')
except:
status = None
return status


class gPodderNotifier(dbus.service.Object):
Expand Down