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:
Arkadiusz Fal
2026-10-11 14:06:15 +02:00
parent 2d3ae1b0e5
commit 8ade5a54d0
10 changed files with 108 additions and 18 deletions

View File

@@ -392,6 +392,7 @@ struct ServerFeedVideo: Decodable, Sendable {
let videoUrl: String?
let isUpcoming: Bool?
let premiereTimestamp: Int64?
let isShort: Bool?
func toVideo() -> Video? {
// Determine content source based on extractor
@@ -418,7 +419,8 @@ struct ServerFeedVideo: Decodable, Sendable {
thumbnails: videoThumbnails?.map { $0.toThumbnail() } ?? [],
isLive: false,
isUpcoming: isUpcoming ?? false,
scheduledStartTime: premiereTimestamp.map { Date(timeIntervalSince1970: TimeInterval($0)) }
scheduledStartTime: premiereTimestamp.map { Date(timeIntervalSince1970: TimeInterval($0)) },
isShort: isShort
)
}
}
@@ -611,6 +613,7 @@ private struct YatteeVideo: Decodable, Sendable {
let liveNow: Bool?
let isUpcoming: Bool?
let premiereTimestamp: Int64?
let isShort: Bool?
nonisolated func toVideo() -> Video {
Video(
@@ -626,7 +629,8 @@ private struct YatteeVideo: Decodable, Sendable {
thumbnails: videoThumbnails?.map { $0.toThumbnail() } ?? [],
isLive: liveNow ?? false,
isUpcoming: isUpcoming ?? false,
scheduledStartTime: premiereTimestamp.map { Date(timeIntervalSince1970: TimeInterval($0)) }
scheduledStartTime: premiereTimestamp.map { Date(timeIntervalSince1970: TimeInterval($0)) },
isShort: isShort
)
}
}