mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 08:01:20 +02:00
Add integration with Jellyseerr/Seerr (#558)
## Description This PR add the ability to integrate with a [Jellyseerr/Seerr server](https://github.com/seerr-team/seerr). ### Features - Login to the Seerr server using API Key, Jellyfin credentials, or local Seerr credentials - Separate Seerr logins per user profile - Search Seerr from the search page - Discover media from Seerr on the nav drawer `Discover` page - Also from movie, series, or person pages - Seamless integration with existing media, i.e. selecting media found from Seerr that already exists on the Jellyfin server, will go directly to the regular media page - Mostly consistent UI between Jellyfin media & Seerr media - Submit requests to Seerr - Cancel submitted requests ### Screenshots  ### Related issues Closes #54 ## Acknowledgements The `app/src/main/seerr/seerr-api.yml` file is copied & modified from https://github.com/seerr-team/seerr/blob/develop/seerr-api.yml. I hope to try to upstream some of the changes in the future.
This commit is contained in:
parent
f4e1b0e171
commit
4c7c465c67
68 changed files with 13369 additions and 137 deletions
7772
app/src/main/seerr/seerr-api.yml
Normal file
7772
app/src/main/seerr/seerr-api.yml
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,191 @@
|
|||
package {{packageName}}.infrastructure
|
||||
|
||||
{{#moshi}}
|
||||
import com.squareup.moshi.Moshi
|
||||
{{#enumUnknownDefaultCase}}
|
||||
import com.squareup.moshi.adapters.EnumJsonAdapter
|
||||
{{/enumUnknownDefaultCase}}
|
||||
{{^moshiCodeGen}}
|
||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||
{{/moshiCodeGen}}
|
||||
{{/moshi}}
|
||||
{{#gson}}
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
{{^threetenbp}}
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
import java.time.OffsetDateTime
|
||||
{{/threetenbp}}
|
||||
{{#threetenbp}}
|
||||
import org.threeten.bp.LocalDate
|
||||
import org.threeten.bp.LocalDateTime
|
||||
import org.threeten.bp.OffsetDateTime
|
||||
{{/threetenbp}}
|
||||
{{#kotlinx-datetime}}
|
||||
import kotlin.time.Instant
|
||||
import kotlinx.datetime.LocalDate
|
||||
import kotlinx.datetime.LocalTime
|
||||
{{/kotlinx-datetime}}
|
||||
import java.util.UUID
|
||||
{{/gson}}
|
||||
{{#jackson}}
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.fasterxml.jackson.databind.SerializationFeature
|
||||
import com.fasterxml.jackson.annotation.JsonInclude
|
||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||
{{/jackson}}
|
||||
{{#kotlinx_serialization}}
|
||||
import java.math.BigDecimal
|
||||
import java.math.BigInteger
|
||||
{{^threetenbp}}
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
import java.time.OffsetDateTime
|
||||
{{/threetenbp}}
|
||||
{{#threetenbp}}
|
||||
import org.threeten.bp.LocalDate
|
||||
import org.threeten.bp.LocalDateTime
|
||||
import org.threeten.bp.OffsetDateTime
|
||||
{{/threetenbp}}
|
||||
import java.util.UUID
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonBuilder
|
||||
import kotlinx.serialization.modules.SerializersModule
|
||||
import kotlinx.serialization.modules.SerializersModuleBuilder
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
{{/kotlinx_serialization}}
|
||||
|
||||
{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object Serializer {
|
||||
{{#moshi}}
|
||||
@JvmStatic
|
||||
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||
.add(OffsetDateTimeAdapter())
|
||||
{{#kotlinx-datetime}}
|
||||
.add(InstantAdapter())
|
||||
.add(LocalDateAdapter())
|
||||
.add(LocalTimeAdapter())
|
||||
{{/kotlinx-datetime}}
|
||||
.add(LocalDateTimeAdapter())
|
||||
.add(LocalDateAdapter())
|
||||
.add(UUIDAdapter())
|
||||
.add(ByteArrayAdapter())
|
||||
.add(URIAdapter())
|
||||
{{^moshiCodeGen}}
|
||||
.add(KotlinJsonAdapterFactory())
|
||||
{{/moshiCodeGen}}
|
||||
.add(BigDecimalAdapter())
|
||||
.add(BigIntegerAdapter())
|
||||
|
||||
@JvmStatic
|
||||
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val moshi: Moshi by lazy {
|
||||
{{#enumUnknownDefaultCase}}
|
||||
SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder)
|
||||
{{/enumUnknownDefaultCase}}
|
||||
moshiBuilder.build()
|
||||
}
|
||||
{{/moshi}}
|
||||
{{#gson}}
|
||||
@JvmStatic
|
||||
val gsonBuilder: GsonBuilder = GsonBuilder()
|
||||
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
|
||||
{{#kotlinx-datetime}}
|
||||
.registerTypeAdapter(Instant::class.java, InstantAdapter())
|
||||
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
||||
.registerTypeAdapter(LocalTime::class.java, LocalTimeAdapter())
|
||||
{{/kotlinx-datetime}}
|
||||
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
|
||||
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
||||
.registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter())
|
||||
{{#generateOneOfAnyOfWrappers}}
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{^isEnum}}
|
||||
{{^hasChildren}}
|
||||
.registerTypeAdapterFactory({{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory())
|
||||
{{/hasChildren}}
|
||||
{{/isEnum}}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
{{/generateOneOfAnyOfWrappers}}
|
||||
|
||||
@JvmStatic
|
||||
val gson: Gson by lazy {
|
||||
gsonBuilder.create()
|
||||
}
|
||||
{{/gson}}
|
||||
{{#jackson}}
|
||||
@JvmStatic
|
||||
val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper()
|
||||
.findAndRegisterModules()
|
||||
.setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
|
||||
{{#enumUnknownDefaultCase}}
|
||||
.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE, true)
|
||||
{{/enumUnknownDefaultCase}}
|
||||
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, {{failOnUnknownProperties}})
|
||||
{{/jackson}}
|
||||
{{#kotlinx_serialization}}
|
||||
private var isAdaptersInitialized = false
|
||||
|
||||
@JvmStatic
|
||||
val kotlinxSerializationAdapters: SerializersModule by lazy {
|
||||
isAdaptersInitialized = true
|
||||
SerializersModule {
|
||||
contextual(BigDecimal::class, BigDecimalAdapter)
|
||||
contextual(BigInteger::class, BigIntegerAdapter)
|
||||
{{^kotlinx-datetime}}
|
||||
contextual(LocalDate::class, LocalDateAdapter)
|
||||
contextual(LocalDateTime::class, LocalDateTimeAdapter)
|
||||
contextual(OffsetDateTime::class, OffsetDateTimeAdapter)
|
||||
{{/kotlinx-datetime}}
|
||||
contextual(UUID::class, UUIDAdapter)
|
||||
contextual(AtomicInteger::class, AtomicIntegerAdapter)
|
||||
contextual(AtomicLong::class, AtomicLongAdapter)
|
||||
contextual(AtomicBoolean::class, AtomicBooleanAdapter)
|
||||
contextual(URI::class, URIAdapter)
|
||||
contextual(URL::class, URLAdapter)
|
||||
contextual(StringBuilder::class, StringBuilderAdapter)
|
||||
|
||||
apply(kotlinxSerializationAdaptersConfiguration)
|
||||
}
|
||||
}
|
||||
|
||||
var kotlinxSerializationAdaptersConfiguration: SerializersModuleBuilder.() -> Unit = {}
|
||||
set(value) {
|
||||
check(!isAdaptersInitialized) {
|
||||
"Cannot configure kotlinxSerializationAdaptersConfiguration after kotlinxSerializationAdapters has been initialized."
|
||||
}
|
||||
field = value
|
||||
}
|
||||
|
||||
private var isJsonInitialized = false
|
||||
|
||||
@JvmStatic
|
||||
val kotlinxSerializationJson: Json by lazy {
|
||||
isJsonInitialized = true
|
||||
Json {
|
||||
serializersModule = kotlinxSerializationAdapters
|
||||
encodeDefaults = true
|
||||
ignoreUnknownKeys = true
|
||||
isLenient = true
|
||||
explicitNulls = false
|
||||
|
||||
apply(kotlinxSerializationJsonConfiguration)
|
||||
}
|
||||
}
|
||||
|
||||
var kotlinxSerializationJsonConfiguration: JsonBuilder.() -> Unit = {}
|
||||
set(value) {
|
||||
check(!isJsonInitialized) {
|
||||
"Cannot configure kotlinxSerializationJsonConfiguration after kotlinxSerializationJson has been initialized."
|
||||
}
|
||||
field = value
|
||||
}
|
||||
{{/kotlinx_serialization}}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue