~ knotless Search/
↑↓ move↵ open⇧↵ all results

grain.social/grain-ios

1 collaborator
0
1
main
46 lines · 1.4 KB Raw History
import Foundation

/// social.grain.gallery.defs#galleryView
struct GrainGallery: Codable, Sendable, Identifiable {
    let uri: String
    let cid: String
    var title: String?
    var description: String?
    var cameras: [String]?
    var location: H3Location?
    var address: Address?
    var locationDisplay: String?
    var facets: [Facet]?
    let creator: GrainProfile
    var record: AnyCodable?
    var items: [GrainPhoto]?
    var favCount: Int?
    /// Accounts the viewer follows who favorited this gallery, capped server-side
    /// for the card facepile. Never includes the viewer.
    var favedByFollowing: [GrainProfile]?
    var commentCount: Int?
    var labels: [ATLabel]?
    var createdAt: String?
    let indexedAt: String
    var viewer: GalleryViewerState?
    var crossPost: CrossPostInfo?
    var labelRevealed: Bool = false

    var id: String {
        uri
    }

    private enum CodingKeys: String, CodingKey {
        case uri, cid, title, description, cameras, location, address, locationDisplay, facets, creator, record, items, favCount, favedByFollowing, commentCount, labels, createdAt, indexedAt, viewer, crossPost
    }
}

/// social.grain.gallery.defs#viewerState
struct GalleryViewerState: Codable, Sendable {
    var fav: String?
}

/// social.grain.gallery.defs#crossPostInfo
struct CrossPostInfo: Codable, Sendable {
    let url: String
}