Skip to content

Commit

Permalink
Merge pull request openhab#134 from kgoderis/sonos
Browse files Browse the repository at this point in the history
Fix small bugs in updateCurrentURIFormatted and updateTrackMetaData
  • Loading branch information
kaikreuzer committed Feb 16, 2015
2 parents 54b135c + ad957f8 commit 25cc1b3
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -600,24 +600,26 @@ protected void updateTrackMetaData() {

if (currentTrack != null) {

String artist = "";
String artist = null;
if (currentTrack.getAlbumArtist().equals("")) {
artist = currentTrack.getCreator();
} else {
artist = currentTrack.getAlbumArtist();
}

String album = currentTrack.getAlbum();
String title = "";
String title = null;
if(!currentTrack.getTitle().contains("x-sonosapi-stream")) {
title = currentTrack.getTitle();
}

// 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");

Expand All @@ -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();
}
Expand Down

0 comments on commit 25cc1b3

Please sign in to comment.