Continue watching feed, watched marks, intro skipping

This commit is contained in:
2026-10-24 19:33:48 +03:00
parent 4b8427310f
commit 33643707f1
22 changed files with 1113 additions and 58 deletions

View File

@@ -65,6 +65,10 @@ class JellyfinSession @Inject constructor(
private val _session = MutableStateFlow<SessionInfo?>(null)
val session: StateFlow<SessionInfo?> = _session.asStateFlow()
private val _restored = MutableStateFlow(false)
/** True once [restore] has run: before that a null [session] means "not read yet", not "signed out". */
val restored: StateFlow<Boolean> = _restored.asStateFlow()
private val _accounts = MutableStateFlow<List<Account>>(emptyList())
/** Saved accounts, most recently used first. */
val accounts: StateFlow<List<Account>> = _accounts.asStateFlow()
@@ -125,9 +129,10 @@ class JellyfinSession @Inject constructor(
currentId = account.id
}
_accounts.value = accounts.sortedByDescending { it.lastUsedAt }
val current = accounts.firstOrNull { it.id == currentId } ?: return false
activate(current)
true
val current = accounts.firstOrNull { it.id == currentId }
current?.let(::activate)
_restored.value = true
current != null
}
/** Saves the account of a successful login (see [ServerLogin]) and makes it current. */