diff --git a/addons/binding/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/handler/ZonePlayerHandler.java b/addons/binding/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/handler/ZonePlayerHandler.java index a18a0ccee35e3..f2aa92eb3371b 100644 --- a/addons/binding/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/handler/ZonePlayerHandler.java +++ b/addons/binding/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/handler/ZonePlayerHandler.java @@ -600,7 +600,7 @@ protected void updateTrackMetaData() { if (currentTrack != null) { - String artist = ""; + String artist = null; if (currentTrack.getAlbumArtist().equals("")) { artist = currentTrack.getCreator(); } else { @@ -608,7 +608,7 @@ protected void updateTrackMetaData() { } String album = currentTrack.getAlbum(); - String title = ""; + String title = null; if(!currentTrack.getTitle().contains("x-sonosapi-stream")) { title = currentTrack.getTitle(); } @@ -616,8 +616,10 @@ protected void updateTrackMetaData() { // update individual variables this.onValueReceived("CurrentArtist", (artist != null) ? artist : "", "AVTransport"); - this.onValueReceived("CurrentTitle", (title != null) ? title : "", - "AVTransport"); + if(title!=null) { + this.onValueReceived("CurrentTitle", (title != null) ? title : "", + "AVTransport"); + } this.onValueReceived("CurrentAlbum", (album != null) ? album : "", "AVTransport"); @@ -635,7 +637,7 @@ protected void updateCurrentURIFormatted() { String coordinator = getCoordinator(); ZonePlayerHandler coordinatorHandler = getHandlerByName(coordinator); - if (coordinatorHandler != null) { + if (coordinatorHandler != null && coordinatorHandler != this) { if(getCurrentURI().contains("x-rincon")) { coordinatorHandler.updateMediaInfo(); }