]> git.basschouten.com Git - openhab-addons.git/commitdiff
[jellyfin] fix multiple sessions for device and update deps (#12794)
authorGiviMAD <GiviMAD@users.noreply.github.com>
Tue, 24 May 2022 20:29:40 +0000 (22:29 +0200)
committerGitHub <noreply@github.com>
Tue, 24 May 2022 20:29:40 +0000 (22:29 +0200)
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
bundles/org.openhab.binding.jellyfin/pom.xml
bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java

index 45d630456a2ced1de722ef3742617168ea158ddc..af0b68d52d2e6e965a015ed7b33690178775f63c 100644 (file)
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-client-core-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-client-cio-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-http-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-http-cio-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-network-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-utils-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-io-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.ktor</groupId>
       <artifactId>ktor-network-tls-jvm</artifactId>
-      <version>1.6.7</version>
+      <version>1.6.8</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.jetbrains.kotlin</groupId>
       <artifactId>kotlin-stdlib</artifactId>
-      <version>1.6.10</version>
+      <version>1.6.21</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.jetbrains.kotlinx</groupId>
       <artifactId>kotlinx-coroutines-core-jvm</artifactId>
-      <version>1.5.2</version>
+      <version>1.6.1</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.jetbrains.kotlinx</groupId>
       <artifactId>kotlinx-coroutines-jdk8</artifactId>
-      <version>1.5.2</version>
+      <version>1.6.1</version>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.jetbrains.kotlinx</groupId>
       <artifactId>kotlinx-serialization-core-jvm</artifactId>
-      <version>1.3.1</version>
+      <version>1.3.3</version>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.jetbrains.kotlinx</groupId>
       <artifactId>kotlinx-serialization-json-jvm</artifactId>
-      <version>1.3.1</version>
+      <version>1.3.3</version>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>io.github.microutils</groupId>
       <artifactId>kotlin-logging-jvm</artifactId>
-      <version>2.1.16</version>
+      <version>2.1.23</version>
+      <scope>compile</scope>
     </dependency>
   </dependencies>
 </project>
index 5e0a3aefdc8147995b00ec252fd5d832006f8048..38947a58f4d9e88e5655efba89272c8625f33b73 100644 (file)
@@ -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);
     }