mirror of
https://github.com/yattee/yattee.git
synced 2025-11-22 22:51:21 +00:00
The hide shorts feature is no longer working due to API changes that prevent reliable detection of short videos. This commit introduces a feature flag system to disable the functionality while preserving the ability to easily restore it if the API issue is resolved. Changes: - Add FeatureFlags.swift with hideShortsEnabled flag (currently disabled) - Hide all HideShortsButtons UI elements when flag is disabled - Disable shorts filtering logic in ContentItemView, FavoriteItemView, and FeedModel - Preserve hideShorts user preference for future restoration
37 lines
988 B
Swift
37 lines
988 B
Swift
import Defaults
|
|
import SwiftUI
|
|
|
|
struct HideShortsButtons: View {
|
|
@Default(.hideShorts) private var hideShorts
|
|
|
|
var body: some View {
|
|
if FeatureFlags.hideShortsEnabled {
|
|
Button {
|
|
hideShorts.toggle()
|
|
} label: {
|
|
Group {
|
|
if hideShorts {
|
|
Label("Short videos: hidden", systemImage: "bolt.slash.fill")
|
|
.help("Short videos: hidden")
|
|
} else {
|
|
Label("Short videos: visible", systemImage: "bolt.fill")
|
|
.help("Short videos: visible")
|
|
}
|
|
}
|
|
#if os(tvOS)
|
|
.font(.caption)
|
|
.imageScale(.small)
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct HideShortsButtons_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
VStack {
|
|
HideShortsButtons()
|
|
}
|
|
}
|
|
}
|