Skip to content

Commit

Permalink
Fix screensaver and media manager displaying video entries
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed May 7, 2024
1 parent 59153d4 commit 6942d92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.jellyfin.sdk.model.api.BaseItemKind
import org.jellyfin.sdk.model.api.ImageFormat
import org.jellyfin.sdk.model.api.ImageType
import org.jellyfin.sdk.model.constant.ItemSortBy
import org.jellyfin.sdk.model.constant.MediaType
import org.koin.compose.koinInject
import timber.log.Timber
import kotlin.time.Duration.Companion.seconds
Expand Down Expand Up @@ -55,7 +56,7 @@ fun DreamHost() {

DreamView(
content = when {
mediaItem != null -> DreamContent.NowPlaying(mediaItem)
mediaItem?.mediaType == MediaType.Audio -> DreamContent.NowPlaying(mediaItem)
libraryShowcase != null -> libraryShowcase!!
else -> DreamContent.Logo
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import org.jellyfin.playback.jellyfin.queue.baseItem
import org.jellyfin.playback.jellyfin.queue.createBaseItemQueueEntry
import org.jellyfin.sdk.api.client.ApiClient
import org.jellyfin.sdk.model.api.BaseItemDto
import org.jellyfin.sdk.model.constant.MediaType
import kotlin.math.max

@Suppress("TooManyFunctions")
Expand Down Expand Up @@ -61,6 +62,7 @@ class RewriteMediaManager(

override val currentAudioItem: BaseItemDto?
get() = playbackManager.state.queue.entry.value?.baseItem
?.takeIf { it.mediaType == MediaType.Audio }

override fun toggleRepeat(): Boolean {
val newMode = when (playbackManager.state.repeatMode.value) {
Expand Down

0 comments on commit 6942d92

Please sign in to comment.