From c482d488d49e74bb040e883120f0bc9e44a29bc8 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Mon, 5 Feb 2024 21:52:47 +0100 Subject: [PATCH] Use data object when applicable --- .../java/org/jellyfin/androidtv/auth/model/LoginState.kt | 8 ++++---- .../jellyfin/androidtv/auth/model/QuickConnectState.kt | 6 +++--- .../org/jellyfin/androidtv/data/querying/ViewQuery.kt | 2 +- playback/core/src/main/kotlin/queue/EmptyQueue.kt | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/auth/model/LoginState.kt b/app/src/main/java/org/jellyfin/androidtv/auth/model/LoginState.kt index dc45f7106..7130adeb5 100644 --- a/app/src/main/java/org/jellyfin/androidtv/auth/model/LoginState.kt +++ b/app/src/main/java/org/jellyfin/androidtv/auth/model/LoginState.kt @@ -3,9 +3,9 @@ package org.jellyfin.androidtv.auth.model import org.jellyfin.sdk.api.client.exception.ApiClientException sealed class LoginState -object AuthenticatingState : LoginState() -object RequireSignInState : LoginState() -object ServerUnavailableState : LoginState() +data object AuthenticatingState : LoginState() +data object RequireSignInState : LoginState() +data object ServerUnavailableState : LoginState() data class ServerVersionNotSupported(val server: Server) : LoginState() data class ApiClientErrorLoginState(val error: ApiClientException) : LoginState() -object AuthenticatedState : LoginState() +data object AuthenticatedState : LoginState() diff --git a/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt b/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt index 3cade9bd8..bc1a701a6 100644 --- a/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt +++ b/app/src/main/java/org/jellyfin/androidtv/auth/model/QuickConnectState.kt @@ -5,12 +5,12 @@ sealed class QuickConnectState /** * State unknown untill first poll completed. */ -object UnknownQuickConnectState : QuickConnectState() +data object UnknownQuickConnectState : QuickConnectState() /** * Server does not have QuickConnect enabled. */ -object UnavailableQuickConnectState : QuickConnectState() +data object UnavailableQuickConnectState : QuickConnectState() /** * Connection is pending. @@ -20,4 +20,4 @@ data class PendingQuickConnectState(val code: String) : QuickConnectState() /** * User connected. */ -object ConnectedQuickConnectState : QuickConnectState() +data object ConnectedQuickConnectState : QuickConnectState() diff --git a/app/src/main/java/org/jellyfin/androidtv/data/querying/ViewQuery.kt b/app/src/main/java/org/jellyfin/androidtv/data/querying/ViewQuery.kt index da2e74fca..1d5f385ce 100644 --- a/app/src/main/java/org/jellyfin/androidtv/data/querying/ViewQuery.kt +++ b/app/src/main/java/org/jellyfin/androidtv/data/querying/ViewQuery.kt @@ -1,3 +1,3 @@ package org.jellyfin.androidtv.data.querying -object ViewQuery +data object ViewQuery diff --git a/playback/core/src/main/kotlin/queue/EmptyQueue.kt b/playback/core/src/main/kotlin/queue/EmptyQueue.kt index 6547bc24c..2171e992d 100644 --- a/playback/core/src/main/kotlin/queue/EmptyQueue.kt +++ b/playback/core/src/main/kotlin/queue/EmptyQueue.kt @@ -2,7 +2,7 @@ package org.jellyfin.playback.core.queue import org.jellyfin.playback.core.queue.item.QueueEntry -object EmptyQueue : Queue { +data object EmptyQueue : Queue { override val size: Int = 0 override suspend fun getItem(index: Int): QueueEntry? = null }