mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2025-05-17 11:26:04 +08:00
Improve intro loading in SdkPlaybackHelper
This commit is contained in:

committed by
Niels van Velzen

parent
540b5e619e
commit
aafebfc546
@ -212,14 +212,19 @@ class SdkPlaybackHelper(
|
||||
}
|
||||
}
|
||||
|
||||
else -> if (allowIntros && !playbackLauncher.useExternalPlayer(mainItem.type) && userPreferences[UserPreferences.cinemaModeEnabled]) {
|
||||
val response by api.userLibraryApi.getIntros(mainItem.id)
|
||||
buildList {
|
||||
addAll(response.items.orEmpty())
|
||||
addAll(getParts(mainItem))
|
||||
else -> {
|
||||
val parts = getParts(mainItem)
|
||||
val addIntros = allowIntros && userPreferences[UserPreferences.cinemaModeEnabled]
|
||||
|
||||
if (addIntros) {
|
||||
val intros = runCatching {
|
||||
api.userLibraryApi.getIntros(mainItem.id).content.items
|
||||
}.getOrNull().orEmpty()
|
||||
|
||||
intros + parts
|
||||
} else {
|
||||
parts
|
||||
}
|
||||
} else {
|
||||
getParts(mainItem)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user