Prioritize backdrop image for cinematic background (#893)
Co-authored-by: Brendan Perry <=>
This commit is contained in:
parent
333530a938
commit
a49b0edc68
|
@ -74,4 +74,13 @@ extension BaseItemDto: Poster {
|
|||
]
|
||||
}
|
||||
}
|
||||
|
||||
func cinematicPosterImageSources() -> [ImageSource] {
|
||||
switch type {
|
||||
case .episode:
|
||||
return [seriesImageSource(.backdrop, maxWidth: UIScreen.main.bounds.width)]
|
||||
default:
|
||||
return [imageSource(.backdrop, maxWidth: UIScreen.main.bounds.width)]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ protocol Poster: Displayable, Hashable {
|
|||
|
||||
func portraitPosterImageSource(maxWidth: CGFloat) -> ImageSource
|
||||
func landscapePosterImageSources(maxWidth: CGFloat, single: Bool) -> [ImageSource]
|
||||
func cinematicPosterImageSources() -> [ImageSource]
|
||||
}
|
||||
|
||||
extension Poster {
|
||||
|
@ -22,4 +23,8 @@ extension Poster {
|
|||
hasher.combine(displayTitle)
|
||||
hasher.combine(subtitle)
|
||||
}
|
||||
|
||||
func cinematicPosterImageSources() -> [ImageSource] {
|
||||
[]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ struct CinematicBackgroundView<Item: Poster>: View {
|
|||
RotateContentView(proxy: proxy)
|
||||
.onChange(of: viewModel.currentItem) { newItem in
|
||||
proxy.update {
|
||||
ImageView(newItem?.landscapePosterImageSources(maxWidth: UIScreen.main.bounds.width, single: false) ?? [])
|
||||
ImageView(newItem?.cinematicPosterImageSources() ?? [])
|
||||
.placeholder {
|
||||
Color.clear
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue