[jellyfin] fix multiple sessions for device and update deps (#12794)

Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
This commit is contained in:
GiviMAD 2022-05-24 22:29:40 +02:00 committed by GitHub
parent 3ee741e63b
commit 2ee6f8493e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 15 deletions

View File

@ -36,82 +36,86 @@
<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>

View 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);
}