From 4b56f84cb5ee57753279c95b31e34d77067b189f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= Date: Wed, 2 Jan 2013 19:11:44 +0200 Subject: [PATCH] Handle missing 'songid' in status (issue #36) mpd sends 'songid' when stopped manually, but does not when the playlist runs out. --- src/mpDris2.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mpDris2.in b/src/mpDris2.in index ff74ed3..811183f 100755 --- a/src/mpDris2.in +++ b/src/mpDris2.in @@ -461,7 +461,7 @@ class MPDWrapper(mpd.MPDClient): self._dbus_service.update_property('org.mpris.MediaPlayer2.Player', 'PlaybackStatus') - if old_status['songid'] == new_status['songid']: + if old_status.get('songid', None) == new_status.get('songid', None): if new_status['state'] == 'play': expected_position = old_position + (new_time - old_time) else: