aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-06-25 15:48:35 +0100
committerConor Curran <conor.curran@canonical.com>2010-06-25 15:48:35 +0100
commit8f532e8faa4d810992ecb2e43dc2f8c5800ce49b (patch)
tree887bd53f7e64548ce2a340f831db2332454240a8 /src
parent0336970086fb3bbd00b3a906e9879f4a50ae015c (diff)
parentdf55c0f3142de41dd742eda7a59a4b1392882d2b (diff)
downloadayatana-indicator-sound-8f532e8faa4d810992ecb2e43dc2f8c5800ce49b.tar.gz
ayatana-indicator-sound-8f532e8faa4d810992ecb2e43dc2f8c5800ce49b.tar.bz2
ayatana-indicator-sound-8f532e8faa4d810992ecb2e43dc2f8c5800ce49b.zip
fix for the album art crasher plus now resetting metadata values on each track change to ensure no stale data is mixed with new data
Diffstat (limited to 'src')
-rw-r--r--src/mpris-controller.vala1
-rw-r--r--src/player-item.vala10
2 files changed, 10 insertions, 1 deletions
diff --git a/src/mpris-controller.vala b/src/mpris-controller.vala
index a6d27be..beaf02c 100644
--- a/src/mpris-controller.vala
+++ b/src/mpris-controller.vala
@@ -56,6 +56,7 @@ public class MprisController : GLib.Object
private void onTrackChange(dynamic DBus.Object mpris_client, HashTable<string,Value?> ht)
{
debug("onTrackChange");
+ this.controller.custom_items[this.controller.METADATA].reset(MetadataMenuitem.attributes_format());
this.controller.custom_items[this.controller.METADATA].update(ht,
MetadataMenuitem.attributes_format());
}
diff --git a/src/player-item.vala b/src/player-item.vala
index 7fcf912..a5c5512 100644
--- a/src/player-item.vala
+++ b/src/player-item.vala
@@ -27,6 +27,13 @@ public class PlayerItem : Dbusmenu.Menuitem
public PlayerItem()
{
}
+
+ public void reset(HashSet<string> attrs){
+ foreach(string s in attrs){
+ debug("attempting to set prop %s to null", s);
+ this.property_set(s, null);
+ }
+ }
public void update(HashTable<string, Value?> data, HashSet<string> attributes)
{
@@ -39,7 +46,8 @@ public class PlayerItem : Dbusmenu.Menuitem
string[] input_keys = property.split("-");
string search_key = input_keys[input_keys.length-1 : input_keys.length][0];
debug("search key = %s", search_key);
- Value v = data.lookup(search_key);
+ Value? v = data.lookup(search_key);
+
if (v.holds (typeof (string))){
debug("with value : %s", v.get_string());
this.property_set(property, this.sanitize_string(v.get_string()));