Fix Collection/Episode Item Empty Image and Cleanup (#1046)
This commit is contained in:
parent
3ba922b4bd
commit
2a9d7c7d17
|
@ -73,7 +73,7 @@ struct ChannelLibraryView: View {
|
|||
|
||||
// MARK: item view
|
||||
|
||||
private func narrowChannelView(channel: ChannelProgram) -> some View {
|
||||
private func compactChannelView(channel: ChannelProgram) -> some View {
|
||||
CompactChannelView(channel: channel.channel)
|
||||
.onSelect {
|
||||
guard let mediaSource = channel.channel.mediaSources?.first else { return }
|
||||
|
@ -84,7 +84,7 @@ struct ChannelLibraryView: View {
|
|||
}
|
||||
}
|
||||
|
||||
private func wideChannelView(channel: ChannelProgram) -> some View {
|
||||
private func detailedChannelView(channel: ChannelProgram) -> some View {
|
||||
DetailedChannelView(channel: channel)
|
||||
.onSelect {
|
||||
guard let mediaSource = channel.channel.mediaSources?.first else { return }
|
||||
|
@ -102,9 +102,9 @@ struct ChannelLibraryView: View {
|
|||
) { channel in
|
||||
switch channelDisplayType {
|
||||
case .grid:
|
||||
narrowChannelView(channel: channel)
|
||||
compactChannelView(channel: channel)
|
||||
case .list:
|
||||
wideChannelView(channel: channel)
|
||||
detailedChannelView(channel: channel)
|
||||
}
|
||||
}
|
||||
.onReachedBottomEdge(offset: .offset(300)) {
|
||||
|
|
|
@ -68,7 +68,7 @@ extension ChannelLibraryView {
|
|||
private func programLabel(for program: BaseItemDto) -> some View {
|
||||
HStack(alignment: .top) {
|
||||
AlternateLayoutView(alignment: .leading) {
|
||||
Text(Date(timeIntervalSince1970: 0), style: .time)
|
||||
Text("00:00 AAA")
|
||||
.monospacedDigit()
|
||||
} content: {
|
||||
if let startDate = program.startDate {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors
|
||||
//
|
||||
|
||||
import BlurHashKit
|
||||
import JellyfinAPI
|
||||
import SwiftUI
|
||||
|
||||
|
@ -24,6 +25,17 @@ extension CollectionItemView {
|
|||
|
||||
VStack(alignment: .center) {
|
||||
ImageView(viewModel.item.imageSource(.backdrop, maxWidth: 600))
|
||||
.placeholder { source in
|
||||
if let blurHash = source.blurHash {
|
||||
BlurHashView(blurHash: blurHash, size: .Square(length: 8))
|
||||
} else {
|
||||
Color.secondarySystemFill
|
||||
.opacity(0.75)
|
||||
}
|
||||
}
|
||||
.failure {
|
||||
SystemImageContentView(systemName: viewModel.item.systemImage)
|
||||
}
|
||||
.posterStyle(.landscape, contentMode: .fill)
|
||||
.frame(maxHeight: 300)
|
||||
.posterShadow()
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors
|
||||
//
|
||||
|
||||
import BlurHashKit
|
||||
import JellyfinAPI
|
||||
import SwiftUI
|
||||
|
||||
|
@ -24,6 +25,17 @@ extension EpisodeItemView {
|
|||
|
||||
VStack(alignment: .center) {
|
||||
ImageView(viewModel.item.imageSource(.primary, maxWidth: 600))
|
||||
.placeholder { source in
|
||||
if let blurHash = source.blurHash {
|
||||
BlurHashView(blurHash: blurHash, size: .Square(length: 8))
|
||||
} else {
|
||||
Color.secondarySystemFill
|
||||
.opacity(0.75)
|
||||
}
|
||||
}
|
||||
.failure {
|
||||
SystemImageContentView(systemName: viewModel.item.systemImage)
|
||||
}
|
||||
.frame(maxHeight: 300)
|
||||
.posterStyle(.landscape)
|
||||
.posterShadow()
|
||||
|
|
Loading…
Reference in New Issue