mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 19:35:02 +00:00
Skip notifications for upcoming/premiere videos
Videos that haven't premiered yet were triggering repeated notifications on every background refresh cycle. Filter them out by checking isUpcoming flag and rejecting videos with future publish dates. Also decode isUpcoming/premiereTimestamp from Yattee Server feed responses instead of hardcoding false/nil.
This commit is contained in:
@@ -402,6 +402,8 @@ struct ServerFeedVideo: Decodable, Sendable {
|
||||
let videoThumbnails: [YatteeThumbnail]?
|
||||
let extractor: String
|
||||
let videoUrl: String?
|
||||
let isUpcoming: Bool?
|
||||
let premiereTimestamp: Int64?
|
||||
|
||||
func toVideo() -> Video? {
|
||||
// Determine content source based on extractor
|
||||
@@ -427,8 +429,8 @@ struct ServerFeedVideo: Decodable, Sendable {
|
||||
likeCount: nil,
|
||||
thumbnails: videoThumbnails?.map { $0.toThumbnail() } ?? [],
|
||||
isLive: false,
|
||||
isUpcoming: false,
|
||||
scheduledStartTime: nil
|
||||
isUpcoming: isUpcoming ?? false,
|
||||
scheduledStartTime: premiereTimestamp.map { Date(timeIntervalSince1970: TimeInterval($0)) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user