Set metadata to ' ' when data is mising (fixes: #122)

This commit is contained in:
Thomas Adamcik 2011-07-17 03:11:02 +02:00
parent 6f268cd491
commit 83ccee0bf5
2 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,7 @@ v0.6.0 (in development)
- Add Listener API, :mod:`mopidy.listeners`, to be implemented by actors
wanting to receive events from the backend. This is a formalization of the
ad hoc events the Last.fm scrobbler has already been using for some time.
- Fix metadata update in Shoutcast streaming (Fixes: :issue:`122`)
v0.5.0 (2011-06-15)

View File

@ -277,10 +277,18 @@ class GStreamer(ThreadingActor):
taglist = gst.TagList()
artists = [a for a in (track.artists or []) if a.name]
# Default to blank data to trick shoutcast into clearing any previous
# values it might have.
taglist[gst.TAG_ARTIST] = u' '
taglist[gst.TAG_TITLE] = u' '
taglist[gst.TAG_ALBUM] = u' '
if artists:
taglist[gst.TAG_ARTIST] = u', '.join([a.name for a in artists])
if track.name:
taglist[gst.TAG_TITLE] = track.name
if track.album and track.album.name:
taglist[gst.TAG_ALBUM] = track.album.name