Changed if else statements. The following situations are handled now:
- name and title can be None - name can be None - title can be None - name and title can contain datapull/814/head
parent
6e2fb17f19
commit
56a2ffca1d
|
@ -144,13 +144,14 @@ class MpdDevice(MediaPlayerDevice):
|
|||
name = self.currentsong.get('name', None)
|
||||
title = self.currentsong.get('title', None)
|
||||
|
||||
if name is None:
|
||||
if name is None and title is None:
|
||||
return "No information received from MPD"
|
||||
elif name is None:
|
||||
return title
|
||||
elif title is None:
|
||||
return name
|
||||
else:
|
||||
if title is None:
|
||||
return name
|
||||
else:
|
||||
return '{}: {}'.format(name, title)
|
||||
return '{}: {}'.format(name, title)
|
||||
|
||||
@property
|
||||
def media_artist(self):
|
||||
|
|
Loading…
Reference in New Issue