Minor bug fix (#2167)
## Description - Fixes typo that could prevent restoring a page with artists or album artists - Clarified some javadocs ### Related issues N/A ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
06c1d622bb
commit
d711760dbe
2 changed files with 5 additions and 11 deletions
|
|
@ -16,7 +16,7 @@ import java.util.UUID
|
|||
/**
|
||||
* Represents the status of the most recently used server
|
||||
*
|
||||
* This can be read/written to shared preferences
|
||||
* This can be saved/retrieved from a [MostRecentServerProvider]
|
||||
*/
|
||||
sealed interface MostRecentServer {
|
||||
/**
|
||||
|
|
@ -58,12 +58,12 @@ sealed interface MostRecentServer {
|
|||
|
||||
interface MostRecentServerProvider {
|
||||
/**
|
||||
* Get the [MostRecentServer] from the shared preferences in [context]
|
||||
* Get the [MostRecentServer] from this provider
|
||||
*/
|
||||
fun get(): MostRecentServer
|
||||
|
||||
/**
|
||||
* Save the [CurrentUser] as the most recent server into the shared preferences in [context]
|
||||
* Save the [CurrentUser] as the most recent server
|
||||
*/
|
||||
suspend fun save(current: CurrentUser)
|
||||
|
||||
|
|
@ -86,9 +86,6 @@ class MostRecentServerSharedPreferences(
|
|||
) : MostRecentServerProvider {
|
||||
private val prefs = getServerSharedPreferences(context)
|
||||
|
||||
/**
|
||||
* Get the [MostRecentServer] from the shared preferences in [context]
|
||||
*/
|
||||
override fun get(): MostRecentServer {
|
||||
val serverId = prefs.getString(SERVER_ID_KEY, null)?.toUUIDOrNull()
|
||||
val serverUrl = prefs.getString(SERVER_URL_KEY, null)
|
||||
|
|
@ -103,9 +100,6 @@ class MostRecentServerSharedPreferences(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the [CurrentUser] as the most recent server into the shared preferences in [context]
|
||||
*/
|
||||
override suspend fun save(current: CurrentUser) {
|
||||
prefs.edit(true) {
|
||||
putString(SERVER_ID_KEY, current.server.id.toServerString())
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ val requestSerializersModule =
|
|||
subclass(GetStudiosRequest::class)
|
||||
subclass(GetRecordingsRequest::class)
|
||||
subclass(GetLiveTvChannelsRequest::class)
|
||||
subclass(GetArtistsHandler::class)
|
||||
subclass(GetAlbumArtistsHandler::class)
|
||||
subclass(GetArtistsRequest::class)
|
||||
subclass(GetAlbumArtistsRequest::class)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue