mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Channels performance improvements
Add settings: Show channel avatars in channels lists Show channel avatars in videos lists Fix #508
This commit is contained in:
@@ -16,6 +16,7 @@ struct VideoBanner: View {
|
||||
@Default(.watchedVideoBadgeColor) private var watchedVideoBadgeColor
|
||||
@Default(.timeOnThumbnail) private var timeOnThumbnail
|
||||
@Default(.roundedThumbnails) private var roundedThumbnails
|
||||
@Default(.showChannelAvatarInVideosListing) private var showChannelAvatarInVideosListing
|
||||
|
||||
@Environment(\.inChannelView) private var inChannelView
|
||||
@Environment(\.inNavigationView) private var inNavigationView
|
||||
@@ -85,10 +86,9 @@ struct VideoBanner: View {
|
||||
if !inChannelView, !video.isLocal || video.localStreamIsRemoteURL {
|
||||
ChannelLinkView(channel: video.channel) {
|
||||
HStack(spacing: Constants.channelDetailsStackSpacing) {
|
||||
if let url = video.channel.thumbnailURLOrCached, video != .fixture {
|
||||
ThumbnailView(url: url)
|
||||
if video != .fixture, showChannelAvatarInVideosListing {
|
||||
ChannelAvatarView(channel: video.channel)
|
||||
.frame(width: Constants.channelThumbnailSize, height: Constants.channelThumbnailSize)
|
||||
.clipShape(Circle())
|
||||
}
|
||||
|
||||
channelLabel
|
||||
|
@@ -24,6 +24,7 @@ struct VideoCell: View {
|
||||
@Default(.watchedVideoStyle) private var watchedVideoStyle
|
||||
@Default(.watchedVideoBadgeColor) private var watchedVideoBadgeColor
|
||||
@Default(.watchedVideoPlayNowBehavior) private var watchedVideoPlayNowBehavior
|
||||
@Default(.showChannelAvatarInVideosListing) private var showChannelAvatarInVideosListing
|
||||
|
||||
private var navigation: NavigationModel { .shared }
|
||||
private var player: PlayerModel { .shared }
|
||||
@@ -161,17 +162,22 @@ struct VideoCell: View {
|
||||
|
||||
HStack(spacing: Constants.channelDetailsStackSpacing) {
|
||||
if !inChannelView,
|
||||
let url = video.channel.thumbnailURLOrCached,
|
||||
showChannelAvatarInVideosListing,
|
||||
video != .fixture
|
||||
{
|
||||
ChannelLinkView(channel: video.channel) {
|
||||
ThumbnailView(url: url)
|
||||
.frame(width: Constants.channelThumbnailSize, height: Constants.channelThumbnailSize)
|
||||
.clipShape(Circle())
|
||||
if showChannelAvatarInVideosListing {
|
||||
ChannelAvatarView(channel: video.channel)
|
||||
.frame(width: Constants.channelThumbnailSize, height: Constants.channelThumbnailSize)
|
||||
} else {
|
||||
channelLabel(badge: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !channelOnThumbnail, !inChannelView {
|
||||
if !channelOnThumbnail,
|
||||
!inChannelView
|
||||
{
|
||||
ChannelLinkView(channel: video.channel) {
|
||||
channelLabel(badge: false)
|
||||
}
|
||||
@@ -264,12 +270,9 @@ struct VideoCell: View {
|
||||
if !channelOnThumbnail, !inChannelView {
|
||||
ChannelLinkView(channel: video.channel) {
|
||||
HStack(spacing: Constants.channelDetailsStackSpacing) {
|
||||
if let url = video.channel.thumbnailURLOrCached,
|
||||
video != .fixture
|
||||
{
|
||||
ThumbnailView(url: url)
|
||||
if video != .fixture, showChannelAvatarInVideosListing {
|
||||
ChannelAvatarView(channel: video.channel)
|
||||
.frame(width: Constants.channelThumbnailSize, height: Constants.channelThumbnailSize)
|
||||
.clipShape(Circle())
|
||||
}
|
||||
|
||||
channelLabel(badge: false)
|
||||
@@ -295,9 +298,8 @@ struct VideoCell: View {
|
||||
video != .fixture
|
||||
{
|
||||
ChannelLinkView(channel: video.channel) {
|
||||
ThumbnailView(url: url)
|
||||
ChannelAvatarView(channel: video.channel)
|
||||
.frame(width: Constants.channelThumbnailSize, height: Constants.channelThumbnailSize)
|
||||
.clipShape(Circle())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user