thumb images for episodes
This commit is contained in:
parent
5ef57dc379
commit
b67aa7a13e
|
@ -129,6 +129,16 @@ public extension BaseItemDto {
|
|||
return URL(string: urlString)!
|
||||
}
|
||||
|
||||
func getSeriesThumbImage(maxWidth: Int) -> URL {
|
||||
let x = UIScreen.main.nativeScale * CGFloat(maxWidth)
|
||||
let urlString = ImageAPI.getItemImageWithRequestBuilder(itemId: seriesId ?? "",
|
||||
imageType: .thumb,
|
||||
maxWidth: Int(x),
|
||||
quality: 96,
|
||||
tag: seriesPrimaryImageTag).URLString
|
||||
return URL(string: urlString)!
|
||||
}
|
||||
|
||||
func getPrimaryImage(maxWidth: Int) -> URL {
|
||||
let imageType = ImageType.primary
|
||||
var imageTag = imageTags?[ImageType.primary.rawValue] ?? ""
|
||||
|
|
|
@ -24,12 +24,15 @@ struct CinematicNextUpCardView: View {
|
|||
ZStack(alignment: .bottomLeading) {
|
||||
|
||||
if item.itemType == .episode {
|
||||
ImageView(src: item.getSeriesBackdropImage(maxWidth: 350))
|
||||
ImageView(sources: [
|
||||
item.getSeriesThumbImage(maxWidth: 350),
|
||||
item.getSeriesBackdropImage(maxWidth: 350),
|
||||
])
|
||||
.frame(width: 350, height: 210)
|
||||
} else {
|
||||
ImageView(sources: [
|
||||
item.getThumbImage(maxWidth: 320),
|
||||
item.getBackdropImage(maxWidth: 320),
|
||||
item.getThumbImage(maxWidth: 350),
|
||||
item.getBackdropImage(maxWidth: 350),
|
||||
],
|
||||
bh: item.getBackdropImageBlurHash())
|
||||
.frame(width: 350, height: 210)
|
||||
|
|
|
@ -25,12 +25,15 @@ struct CinematicResumeCardView: View {
|
|||
ZStack(alignment: .bottom) {
|
||||
|
||||
if item.itemType == .episode {
|
||||
ImageView(src: item.getSeriesBackdropImage(maxWidth: 350))
|
||||
ImageView(sources: [
|
||||
item.getSeriesThumbImage(maxWidth: 350),
|
||||
item.getSeriesBackdropImage(maxWidth: 350),
|
||||
])
|
||||
.frame(width: 350, height: 210)
|
||||
} else {
|
||||
ImageView(sources: [
|
||||
item.getThumbImage(maxWidth: 320),
|
||||
item.getBackdropImage(maxWidth: 320),
|
||||
item.getThumbImage(maxWidth: 350),
|
||||
item.getBackdropImage(maxWidth: 350),
|
||||
],
|
||||
bh: item.getBackdropImageBlurHash())
|
||||
.frame(width: 350, height: 210)
|
||||
|
|
|
@ -27,13 +27,21 @@ struct ContinueWatchingView: View {
|
|||
VStack(alignment: .leading) {
|
||||
|
||||
ZStack {
|
||||
ImageView(sources: [
|
||||
item.getThumbImage(maxWidth: 320),
|
||||
item.getBackdropImage(maxWidth: 320),
|
||||
],
|
||||
bh: item.getBackdropImageBlurHash())
|
||||
.frame(width: 320, height: 180)
|
||||
.accessibilityIgnoresInvertColors()
|
||||
Group {
|
||||
if item.itemType == .episode {
|
||||
ImageView(sources: [
|
||||
item.getSeriesThumbImage(maxWidth: 320),
|
||||
item.getSeriesBackdropImage(maxWidth: 320),
|
||||
])
|
||||
.frame(width: 320, height: 180)
|
||||
} else {
|
||||
ImageView(sources: [
|
||||
item.getThumbImage(maxWidth: 320),
|
||||
item.getBackdropImage(maxWidth: 320),
|
||||
])
|
||||
.frame(width: 320, height: 180)
|
||||
}
|
||||
}
|
||||
|
||||
HStack {
|
||||
VStack {
|
||||
|
|
Loading…
Reference in New Issue