From 83ccee0bf58dee09632b11ad2f13095e1ec79125 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sun, 17 Jul 2011 03:11:02 +0200 Subject: [PATCH] Set metadata to ' ' when data is mising (fixes: #122) --- docs/changes.rst | 1 + mopidy/gstreamer.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/docs/changes.rst b/docs/changes.rst index 5d2ab57d..5506bfb0 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -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) diff --git a/mopidy/gstreamer.py b/mopidy/gstreamer.py index 166c487e..b5e38b92 100644 --- a/mopidy/gstreamer.py +++ b/mopidy/gstreamer.py @@ -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