From: GiviMAD Date: Tue, 24 May 2022 20:29:40 +0000 (+0200) Subject: [jellyfin] fix multiple sessions for device and update deps (#12794) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=2ee6f8493ec951b11263533ad67c96d7450b8053;p=openhab-addons.git [jellyfin] fix multiple sessions for device and update deps (#12794) Signed-off-by: Miguel Álvarez Díez --- diff --git a/bundles/org.openhab.binding.jellyfin/pom.xml b/bundles/org.openhab.binding.jellyfin/pom.xml index 45d630456a..af0b68d52d 100644 --- a/bundles/org.openhab.binding.jellyfin/pom.xml +++ b/bundles/org.openhab.binding.jellyfin/pom.xml @@ -36,82 +36,86 @@ io.ktor ktor-client-core-jvm - 1.6.7 + 1.6.8 compile io.ktor ktor-client-cio-jvm - 1.6.7 + 1.6.8 compile io.ktor ktor-http-jvm - 1.6.7 + 1.6.8 compile io.ktor ktor-http-cio-jvm - 1.6.7 + 1.6.8 compile io.ktor ktor-network-jvm - 1.6.7 + 1.6.8 compile io.ktor ktor-utils-jvm - 1.6.7 + 1.6.8 compile io.ktor ktor-io-jvm - 1.6.7 + 1.6.8 compile io.ktor ktor-network-tls-jvm - 1.6.7 + 1.6.8 compile org.jetbrains.kotlin kotlin-stdlib - 1.6.10 + 1.6.21 compile org.jetbrains.kotlinx kotlinx-coroutines-core-jvm - 1.5.2 + 1.6.1 compile org.jetbrains.kotlinx kotlinx-coroutines-jdk8 - 1.5.2 + 1.6.1 + compile org.jetbrains.kotlinx kotlinx-serialization-core-jvm - 1.3.1 + 1.3.3 + compile org.jetbrains.kotlinx kotlinx-serialization-json-jvm - 1.3.1 + 1.3.3 + compile io.github.microutils kotlin-logging-jvm - 2.1.16 + 2.1.23 + compile diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java index 5e0a3aefdc..38947a58f4 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java @@ -383,7 +383,7 @@ public class JellyfinServerHandler extends BaseBridgeHandler { @Nullable SessionInfo clientSession = sessions.stream() .filter(session -> Objects.equals(session.getDeviceId(), handler.getThing().getUID().getId())) - .findFirst().orElse(null); + .sorted((a, b) -> b.getLastActivityDate().compareTo(a.getLastActivityDate())).findFirst().orElse(null); handler.updateStateFromSession(clientSession); }