Allow videos in posts, simplify post image view

This commit is contained in:
Christoph Hagen
2025-01-17 23:24:56 +01:00
parent 60716fca20
commit bc3f21e7e4
10 changed files with 175 additions and 172 deletions

View File

@ -13,16 +13,16 @@ struct FeedEntryData {
let text: [String]
let images: [ImageSet]
let media: Media?
init(entryId: String, title: String?, textAboveTitle: String, link: Link?, tags: [Tag], text: [String], images: [ImageSet]) {
init(entryId: String, title: String?, textAboveTitle: String, link: Link?, tags: [Tag], text: [String], media: Media?) {
self.entryId = entryId
self.title = title
self.textAboveTitle = textAboveTitle
self.link = link
self.tags = tags
self.text = text
self.images = images
self.media = media
}
struct Link {
@ -40,4 +40,16 @@ struct FeedEntryData {
let url: String
}
enum Media {
case images([ImageSet])
case video([FileResource])
}
var requiresSwiper: Bool {
if case .images(let images) = media, images.count > 1 {
return true
}
return false
}
}