mirror of
https://github.com/yattee/yattee.git
synced 2026-10-26 06:32:53 +00:00
Add a Hide Shorts toggle to the view options
Videos carry isShort from Yattee Server and Piped, and Invidious feed entries are taken as Shorts when they arrive with no length and aren't live or upcoming: the feed comes from RSS, which lists Shorts, while lengths come from the Videos tab, which doesn't. Subscriptions, search and instance browse hide videos known to be Shorts when the toggle is on; videos whose source can't tell are always shown.
This commit is contained in:
@@ -50,6 +50,7 @@ struct SearchView: View {
|
||||
@AppStorage("searchRowStyle") private var rowStyle: VideoRowStyle = .regular
|
||||
@AppStorage("searchGridColumns") private var gridColumns = 2
|
||||
@AppStorage("searchHideWatched") private var hideWatched = false
|
||||
@AppStorage("searchHideShorts") private var hideShorts = false
|
||||
|
||||
/// List style from centralized settings.
|
||||
private var listStyle: VideoListStyle {
|
||||
@@ -172,6 +173,9 @@ struct SearchView: View {
|
||||
.onChange(of: hideWatched) { _, newValue in
|
||||
searchViewModel?.hideWatchedVideos = newValue
|
||||
}
|
||||
.onChange(of: hideShorts) { _, newValue in
|
||||
searchViewModel?.hideShorts = newValue
|
||||
}
|
||||
.onChange(of: saveRecentSearches) { _, _ in
|
||||
loadSearchHistory()
|
||||
}
|
||||
@@ -203,6 +207,7 @@ struct SearchView: View {
|
||||
rowStyle: $rowStyle,
|
||||
gridColumns: $gridColumns,
|
||||
hideWatched: $hideWatched,
|
||||
hideShorts: $hideShorts,
|
||||
maxGridColumns: gridConfig.maxColumns
|
||||
)
|
||||
}
|
||||
@@ -389,6 +394,7 @@ struct SearchView: View {
|
||||
settingsManager: appEnvironment.settingsManager
|
||||
)
|
||||
searchViewModel?.hideWatchedVideos = hideWatched
|
||||
searchViewModel?.hideShorts = hideShorts
|
||||
loadFilters()
|
||||
loadSearchHistory()
|
||||
loadRecentChannels()
|
||||
@@ -410,6 +416,7 @@ struct SearchView: View {
|
||||
settingsManager: appEnvironment.settingsManager
|
||||
)
|
||||
searchViewModel?.hideWatchedVideos = hideWatched
|
||||
searchViewModel?.hideShorts = hideShorts
|
||||
loadFilters()
|
||||
|
||||
// Re-run search if we had results
|
||||
|
||||
Reference in New Issue
Block a user