try fix jukebox

This commit is contained in:
_Bastler 2022-01-21 13:11:48 +01:00
parent 2eec3627d2
commit 447c137e4c

View File

@ -227,6 +227,9 @@ public class JukeboxManager implements SmartInitializingSingleton {
}
}
return status;
} else {
logger.debug("no device, try to start playback!");
tryStartPlayback();
}
return JsonNull.INSTANCE;
@ -341,8 +344,16 @@ public class JukeboxManager implements SmartInitializingSingleton {
return;
}
if (!StringUtils.hasText(config.getDeviceId())) {
config.setActive(false);
systemPropertyManager.set(ACTIVE, String.valueOf(config.isActive()));
logger.debug("discard addToQueue due to missing device id");
return;
}
MultiValueMap<String, String> queryParameters = new LinkedMultiValueMap<String, String>();
queryParameters.add("uri", uri);
queryParameters.add("device_id", config.getDeviceId());
WebClient.RequestBodySpec request = webClient.method(HttpMethod.POST)
.uri(uriBuilder -> uriBuilder.path("/v1/me/player/queue")
.queryParams(queryParameters).build())