Add hiding short videos

This commit is contained in:
Arkadiusz Fal
2023-02-25 16:42:18 +01:00
parent ef401168ec
commit 2b18f0cffa
18 changed files with 163 additions and 20 deletions

View File

@@ -14,6 +14,7 @@ struct ChannelPlaylistView: View {
@Environment(\.colorScheme) private var colorScheme
@Environment(\.navigationStyle) private var navigationStyle
@Default(.channelPlaylistListingStyle) private var channelPlaylistListingStyle
@Default(.hideShorts) private var hideShorts
@ObservedObject private var accounts = AccountsModel.shared
var player = PlayerModel.shared
@@ -104,6 +105,7 @@ struct ChannelPlaylistView: View {
ToolbarItem(placement: playlistButtonsPlacement) {
HStack {
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
HideShortsButtons(hide: $hideShorts)
ShareButton(contentItem: contentItem)
favoriteButton
@@ -131,6 +133,10 @@ struct ChannelPlaylistView: View {
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
Section {
HideShortsButtons(hide: $hideShorts)
}
Section {
SettingsButtons()
}

View File

@@ -32,6 +32,7 @@ struct ChannelVideosView: View {
@Default(.channelPlaylistListingStyle) private var channelPlaylistListingStyle
@Default(.expandChannelDescription) private var expandChannelDescription
@Default(.hideShorts) private var hideShorts
var presentedChannel: Channel? {
store.item ?? channel ?? recents.presentedChannel
@@ -100,6 +101,7 @@ struct ChannelVideosView: View {
}
.environment(\.inChannelView, true)
.environment(\.listingStyle, channelPlaylistListingStyle)
.environment(\.hideShorts, hideShorts)
#if os(tvOS)
.prefersDefaultFocus(in: focusNamespace)
#endif
@@ -131,6 +133,9 @@ struct ChannelVideosView: View {
ToolbarItem {
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
}
ToolbarItem {
HideShortsButtons(hide: $hideShorts)
}
ToolbarItem {
contentTypePicker
}
@@ -271,6 +276,10 @@ struct ChannelVideosView: View {
}
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
Section {
HideShortsButtons(hide: $hideShorts)
}
}
} label: {
HStack(spacing: 12) {