Channels caching

This commit is contained in:
Arkadiusz Fal
2022-12-14 00:07:32 +01:00
parent d9622cf24c
commit 3b31f21c81
18 changed files with 151 additions and 18 deletions

View File

@@ -74,8 +74,11 @@ struct VideoBanner: View {
HStack {
HStack {
if !inChannelView {
ThumbnailView(url: video?.channel.thumbnailURL)
if !inChannelView,
let video,
let url = video.channel.thumbnailURLOrCached
{
ThumbnailView(url: url)
.frame(width: 30, height: 30)
.clipShape(Circle())
}

View File

@@ -166,8 +166,18 @@ struct VideoCell: View {
videoDetail(video.displayTitle, lineLimit: 5)
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
if !channelOnThumbnail, !inChannelView {
channelControl(badge: false)
HStack(spacing: 12) {
if !inChannelView,
let video,
let url = video.channel.thumbnailURLOrCached
{
ThumbnailView(url: url)
.frame(width: 30, height: 30)
.clipShape(Circle())
}
if !channelOnThumbnail, !inChannelView {
channelControl(badge: false)
}
}
if additionalDetailsAvailable {
@@ -271,6 +281,15 @@ struct VideoCell: View {
.padding(.bottom, 4)
HStack(spacing: 8) {
if !inChannelView,
let video,
let url = video.channel.thumbnailURLOrCached
{
ThumbnailView(url: url)
.frame(width: 30, height: 30)
.clipShape(Circle())
}
if let date = video.publishedDate {
HStack(spacing: 2) {
Text(date)
@@ -512,7 +531,7 @@ struct VideoCell_Preview: PreviewProvider {
#if os(macOS)
.frame(maxWidth: 300, maxHeight: 250)
#elseif os(iOS)
.frame(maxWidth: 300, maxHeight: 200)
.frame(maxWidth: 600, maxHeight: 200)
#endif
.injectFixtureEnvironmentObjects()
}