Proper title, added album and artist for Squeezebox (#3735)

* Proper title, added album and artist

Title had previously concatenated artist - title.

* Made changes suggested by @balloobbot
This commit is contained in:
Scott Reston 2016-10-13 12:07:10 -04:00 committed by Paulus Schoutsen
parent aa8622f8e8
commit 39a446c43c

View File

@ -126,7 +126,8 @@ class LogitechMediaServer(object):
# a (artist): Artist name 'artist' # a (artist): Artist name 'artist'
# d (duration): Song duration in seconds 'duration' # d (duration): Song duration in seconds 'duration'
# K (artwork_url): URL to remote artwork # K (artwork_url): URL to remote artwork
tags = 'adK' # l (album): Album, including the server's "(N of M)"
tags = 'adKl'
new_status = {} new_status = {}
try: try:
telnet = telnetlib.Telnet(self.host, self.port) telnet = telnetlib.Telnet(self.host, self.port)
@ -236,14 +237,24 @@ class SqueezeBoxDevice(MediaPlayerDevice):
@property @property
def media_title(self): def media_title(self):
"""Title of current playing media.""" """Title of current playing media."""
if 'artist' in self._status and 'title' in self._status: if 'title' in self._status:
return '{artist} - {title}'.format( return self._status['title']
artist=self._status['artist'],
title=self._status['title']
)
if 'current_title' in self._status: if 'current_title' in self._status:
return self._status['current_title'] return self._status['current_title']
@property
def media_artist(self):
"""Artist of current playing media."""
if 'artist' in self._status:
return self._status['artist']
@property
def media_album_name(self):
"""Album of current playing media."""
if 'album' in self._status:
return self._status['album'].rstrip()
@property @property
def supported_media_commands(self): def supported_media_commands(self):
"""Flag of media commands that are supported.""" """Flag of media commands that are supported."""