mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[ring] Fix download of videos (#20166)
* Fix download of videos Signed-off-by: Paul Smedley <paul@smedley.id.au>
This commit is contained in:
+3
-4
@@ -300,10 +300,9 @@ public class RestClient {
|
||||
JsonObject obj = JsonParser.parseString(jsonResult).getAsJsonObject();
|
||||
if (obj.get("url").getAsString().startsWith("http")) {
|
||||
URL url = new URI(obj.get("url").getAsString()).toURL();
|
||||
InputStream in = url.openStream();
|
||||
Files.copy(in, Paths.get(fullfilepath), StandardCopyOption.REPLACE_EXISTING);
|
||||
in.close();
|
||||
logger.info("fullfilepath.length() = {}", fullfilepath.length());
|
||||
try (InputStream in = url.openStream()) {
|
||||
Files.copy(in, Paths.get(fullfilepath), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
if (!fullfilepath.isEmpty()) {
|
||||
urlFound = true;
|
||||
break;
|
||||
|
||||
+2
@@ -45,6 +45,7 @@ import org.openhab.binding.ring.internal.discovery.RingDiscoveryService;
|
||||
import org.openhab.binding.ring.internal.errors.AuthenticationException;
|
||||
import org.openhab.binding.ring.internal.utils.RingUtils;
|
||||
import org.openhab.core.OpenHAB;
|
||||
import org.openhab.core.common.ThreadPoolManager;
|
||||
import org.openhab.core.config.core.Configuration;
|
||||
import org.openhab.core.library.types.OnOffType;
|
||||
import org.openhab.core.library.types.StringType;
|
||||
@@ -133,6 +134,7 @@ public class AccountHandler extends BaseBridgeHandler implements RingAccount {
|
||||
this.registry = new RingDeviceRegistry();
|
||||
this.restClient = new RestClient(httpClient);
|
||||
this.servlet = ringVideoServlet;
|
||||
this.videoExecutorService = ThreadPoolManager.getScheduledPool("ring");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user