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

@ -79,6 +79,17 @@ final class LoadingContext {
return nil
}
func postMedia(_ imageId: String) -> FileResource? {
guard let image = file(imageId) else {
return nil
}
if image.type.isImage || image.type.isVideo {
return image
}
error("Post Media \(imageId) is not an image or video")
return nil
}
func item(itemId: ItemId) -> Item? {
switch itemId.type {
case .post: