Refactor usage of deprecated method (#18321)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
pull/18324/head
Jacob Laursen 2025-02-24 19:07:07 +01:00 committed by GitHub
parent 152613f29e
commit bba5e174c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -15,7 +15,7 @@ package org.openhab.binding.sonos.internal.handler;
import static org.openhab.binding.sonos.internal.SonosBindingConstants.*;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -741,10 +741,9 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
try {
URL serviceDescrUrl = service.getDescriptorURL(this);
if (serviceDescrUrl != null) {
url = new URL(serviceDescrUrl.getProtocol(), serviceDescrUrl.getHost(),
serviceDescrUrl.getPort(), albumArtURI).toExternalForm();
url = serviceDescrUrl.toURI().resolve(albumArtURI).toString();
}
} catch (MalformedURLException e) {
} catch (URISyntaxException e) {
logger.debug("Failed to build a valid album art URL from {}: {}", albumArtURI, e.getMessage());
}
}