mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Fixes & improvements to Jellyseer integration (#783)
## Description Fixes several bugs and makes it easier to log in to a Jellyseer instance - Fix initial focus & next focus on the add server dialog - Don't use an API key for non-API key auth (credit to @voc0der in #734 for suggesting this) - Show trailers for TV shows - Fix incorrect/missing similar and recommended rows for both movies & TV shows - Allow empty password for Jellyfin users without a password Log in will now try variations of the input URL such as add the protocol and/or default port. This is similar to the regular Jellyfin login process. ### Related issues Fixes #778 Fixes #750 Fixes #740 Might help with #747 Fixes https://github.com/damontecres/Wholphin/issues/764#issuecomment-3801324648
This commit is contained in:
parent
3428f2b208
commit
e93100c788
11 changed files with 234 additions and 96 deletions
|
|
@ -30,6 +30,7 @@ import okhttp3.OkHttpClient
|
|||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
/**
|
||||
* Manages saves/loading Seerr servers from the local DB. Also will update the current [SeerrApi] as needed.
|
||||
|
|
@ -137,7 +138,17 @@ class SeerrServerRepository
|
|||
username: String?,
|
||||
passwordOrApiKey: String,
|
||||
): LoadingState {
|
||||
val api = SeerrApiClient(url, passwordOrApiKey, okHttpClient)
|
||||
val apiKey = passwordOrApiKey.takeIf { authMethod == SeerrAuthMethod.API_KEY }
|
||||
val api =
|
||||
SeerrApiClient(
|
||||
url,
|
||||
apiKey,
|
||||
okHttpClient
|
||||
.newBuilder()
|
||||
.connectTimeout(5.seconds)
|
||||
.readTimeout(6.seconds)
|
||||
.build(),
|
||||
)
|
||||
login(api, authMethod, username, passwordOrApiKey)
|
||||
return LoadingState.Success
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue