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 data
pull/814/head
Richard Arends 2015-12-29 22:10:09 +01:00
parent 6e2fb17f19
commit 56a2ffca1d
1 changed files with 6 additions and 5 deletions

View File

@ -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):