don?t crash on stored playlists
This commit is contained in:
parent
c4feb11d0d
commit
5384548dc1
1 changed files with 12 additions and 9 deletions
3
mcg.py
3
mcg.py
|
|
@ -267,6 +267,7 @@ class MCGClient(MCGBase, mpd.MPDClient):
|
|||
album = None
|
||||
pos = None
|
||||
if song:
|
||||
try:
|
||||
hash = MCGAlbum.hash(song['album'], song['date'])
|
||||
if hash in self._albums:
|
||||
album = self._albums[hash]
|
||||
|
|
@ -276,6 +277,8 @@ class MCGClient(MCGBase, mpd.MPDClient):
|
|||
if '/' in pos:
|
||||
pos = pos[0: pos.index('/')]
|
||||
pos = int(pos) - 1
|
||||
except KeyError:
|
||||
pass
|
||||
self._state = state
|
||||
self._callback(MCGClient.SIGNAL_STATUS, state, album, pos, volume, error)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue