diff --git a/Shared/Videos/ThumbnailView.swift b/Shared/Videos/ThumbnailView.swift index cb82ce6f..540e0ae8 100644 --- a/Shared/Videos/ThumbnailView.swift +++ b/Shared/Videos/ThumbnailView.swift @@ -44,13 +44,13 @@ struct ThumbnailView: View { var webImage: some View { WebImage(url: url) - .resizable() .onFailure { _ in if let url { thumbnails.insertUnloadable(url) } } .placeholder { placeholder } + .resizable() } @ViewBuilder var asyncImageIfAvailable: some View { @@ -76,6 +76,8 @@ struct ThumbnailView: View { } var placeholder: some View { - Rectangle().fill(Color("PlaceholderColor")) + Rectangle() + .fill(Color("PlaceholderColor")) + .aspectRatio(Constants.aspectRatio16x9, contentMode: .fit) } } diff --git a/Shared/Videos/VideoCell.swift b/Shared/Videos/VideoCell.swift index 3095ad03..016fcd7d 100644 --- a/Shared/Videos/VideoCell.swift +++ b/Shared/Videos/VideoCell.swift @@ -429,17 +429,15 @@ struct VideoCell: View { } .lineLimit(1) } + .aspectRatio(Constants.aspectRatio16x9, contentMode: .fit) } private var thumbnailImage: some View { - Group { - VideoCellThumbnail(video: video) - + VideoCellThumbnail(video: video) #if os(tvOS) - .frame(minHeight: 320) + .frame(minHeight: 320) #endif - } - .mask(RoundedRectangle(cornerRadius: thumbnailRoundingCornerRadius)) + .mask(RoundedRectangle(cornerRadius: thumbnailRoundingCornerRadius)) } private var time: String? { @@ -477,11 +475,13 @@ struct VideoCellThumbnail: View { private var thumbnails: ThumbnailsModel { .shared } var body: some View { - let (url, quality) = thumbnails.best(video) - let aspectRatio = (quality == .default || quality == .high) ? Constants.aspectRatio4x3 : Constants.aspectRatio16x9 + let (url, _) = thumbnails.best(video) ThumbnailView(url: url) - .aspectRatio(aspectRatio, contentMode: .fill) + .scaledToFill() + .frame(maxWidth: .infinity) + .aspectRatio(Constants.aspectRatio16x9, contentMode: .fit) + .clipped() } }