Skip to content

Commit

Permalink
Improve intro loading in SdkPlaybackHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Jul 15, 2024
1 parent 540b5e6 commit aafebfc
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit aafebfc

Please sign in to comment.