Add support for server plugin (#1384)

## Description
PR to add support for a Wholphin server plugin:
https://github.com/damontecres/jellyfin-plugin-wholphin

Note: The plugin is not required to use Wholphin. It adds features the
server admin can use to set default settings like the home page or
eventually Seerr connection info.

### Changes
Wholphin will use the home page settings in order of:
1. Saved on the device locally
2. Saved on the server in the user's profile settings (display
preferences)
3. Provided by `jellyfin-plugin-wholphin`
4. Default fallback: combined continue watching & recently added in
libraries

Under customize home page, you can now see the "source" of the home
settings. This also allows to pick a different source

Finally, instead of the home customization being saved in the background
only locally, if there are any changes, a dialog is shown with options
to save locally, server-side user profile, or discard.

So overall, it's more clear where the home page settings are from and
where the user wants to save them.

### Install

[See instructions
here](https://github.com/damontecres/Wholphin/releases/tag/develop-server-plugin)

### Related issues
Related to #598

### Testing
WIP

## Screenshots
N/A

## AI or LLM usage
None

---------

Co-authored-by: Mario Reisinger <marioreisinger95@gmail.com>
This commit is contained in:
Damontecres 2026-10-19 14:41:08 -04:00 • committed by GitHub
parent e273195e93
commit 551501fa75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 2331 additions and 858 deletions

View file

@ -1,7 +1,9 @@
package com.github.damontecres.wholphin.test
import com.github.damontecres.wholphin.data.model.HomeGetItemsFilter
import com.github.damontecres.wholphin.data.model.HomeRowConfig
import com.github.damontecres.wholphin.data.model.HomeRowViewOptions
import com.github.damontecres.wholphin.data.model.KeyValueEntry
import com.github.damontecres.wholphin.preferences.PrefContentScale
import com.github.damontecres.wholphin.services.HomeSettingsService
import com.github.damontecres.wholphin.ui.AspectRatio
@ -13,7 +15,6 @@ import org.jellyfin.sdk.model.UUID
import org.jellyfin.sdk.model.api.BaseItemKind
import org.jellyfin.sdk.model.api.ItemSortBy
import org.jellyfin.sdk.model.api.SortOrder
import org.jellyfin.sdk.model.api.request.GetItemsRequest
import org.junit.Assert
import org.junit.Test
import kotlin.reflect.KClass
@ -61,8 +62,8 @@ class TestHomeRowSamples {
),
HomeRowConfig.GetItems(
name = "Episodes by date created",
getItems =
GetItemsRequest(
filter =
HomeGetItemsFilter(
parentId = UUID.randomUUID(),
recursive = true,
isFavorite = true,
@ -77,6 +78,12 @@ class TestHomeRowSamples {
HomeRowConfig.TvPrograms(),
HomeRowConfig.TvChannels(),
HomeRowConfig.Suggestions(parentId = UUID.randomUUID()),
HomeRowConfig.CustomEndpoint(
endpoint = "/path/to/items",
title = "Items",
query = listOf(KeyValueEntry("key", "value")),
headers = listOf(KeyValueEntry("X-Header", "1234")),
),
)
}
@ -100,6 +107,7 @@ class TestHomeRowSamples {
is HomeRowConfig.Suggestions -> foundTypes.add(it::class)
is HomeRowConfig.TvChannels -> foundTypes.add(it::class)
is HomeRowConfig.Studios -> foundTypes.add(it::class)
is HomeRowConfig.CustomEndpoint -> foundTypes.add(it::class)
}
}
Assert.assertEquals(HomeRowConfig::class.sealedSubclasses.size, foundTypes.size)
@ -126,12 +134,10 @@ class TestHomeRowSamples {
context = mockk(),
api = mockk(),
serverRepository = mockk(),
userPreferencesService = mockk(),
navDrawerService = mockk(),
latestNextUpService = mockk(),
imageUrlService = mockk(),
suggestionService = mockk(),
displayPreferencesService = mockk(),
serverPluginApi = mockk(),
serverDao = mockk(),
)
val str = """{
@ -149,7 +155,7 @@ class TestHomeRowSamples {
]
}"""
val jsonElement = service.jsonParser.parseToJsonElement(str)
val jsonElement = HomeSettingsService.jsonParser.parseToJsonElement(str)
val settings = service.decode(jsonElement)
Assert.assertEquals(1, settings.rows.size)
}