fix(tracking): Fix crashing for Jellyfin enhanced tracking (#1658)

This commit is contained in:
Secozzi 2024-07-02 19:37:02 +00:00 committed by GitHub
parent 7040eb4d83
commit 69b9db4e8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.data.track.jellyfin
import eu.kanade.tachiyomi.BuildConfig
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
import eu.kanade.tachiyomi.animesource.sourcePreferences
import okhttp3.Interceptor
import okhttp3.Response
import tachiyomi.domain.source.anime.service.AnimeSourceManager
@ -51,7 +52,7 @@ class JellyfinInterceptor : Interceptor {
private fun getApiKey(userId: String): String? {
for (i in 1..MAX_JELLYFIN_SOURCES) {
val sourceId = getId(i)
val preferences = (sourceManager.get(sourceId) as ConfigurableAnimeSource).getSourcePreferences()
val preferences = (sourceManager.get(sourceId) as ConfigurableAnimeSource).sourcePreferences()
val sourceUserId = preferences.getString("user_id", "")
if (sourceUserId.isNullOrEmpty()) {