tv-anarchy/Sources/TVAnarchyiOS/BridgeModels.swift
Natalie f0669f1ca8 feat(ios): TVAnarchyiOS app target + UI tests
(cherry picked from commit 7f8f4b0dd92358ba687f8230a922d8f316cb06e9)
2026-06-09 05:50:26 -07:00

32 lines
927 B
Swift

// Wire models for the plum-control-bridge HTTP API. These mirror the JSON the
// bridge emits (src/http.ts in plum-control-mcp) one-for-one. The iOS app is a
// pure bridge client it never touches the filesystem or SSH so these are the
// only "library" types it knows.
import Foundation
struct BridgeShow: Codable, Identifiable, Hashable {
let id: String
let name: String
let episodeCount: Int
let seasons: [Int]
let episodes: [BridgeEpisode]
}
struct BridgeEpisode: Codable, Identifiable, Hashable {
/// Opaque, server-issued stream id (base64url of the file path on black/plum).
let id: String
let season: Int
let episode: Int
let label: String
let ext: String
/// e.g. "S01E02" compact badge for the list row.
var code: String {
String(format: "S%02dE%02d", season, episode)
}
}
struct ShowsResponse: Codable {
let shows: [BridgeShow]
}