diff --git a/Sources/EffemKit/Models/PodcastSearchResult.swift b/Sources/EffemKit/Models/PodcastSearchResult.swift index b87331d..f3d3fc1 100644 --- a/Sources/EffemKit/Models/PodcastSearchResult.swift +++ b/Sources/EffemKit/Models/PodcastSearchResult.swift @@ -16,6 +16,12 @@ public struct PodcastResult: Codable, Sendable, Identifiable { public let social: SocialOverlay? public var id: Int { feedId } + + enum CodingKeys: String, CodingKey { + case feedId = "id" + case title, url, description, author, image, artwork + case language, categories, episodeCount, podcastGuid, social + } } /// Response from `xyz.effem.search.podcasts`. @@ -47,6 +53,13 @@ public struct EpisodeResult: Codable, Sendable, Identifiable { public let social: SocialOverlay? public var id: Int { episodeId } + + enum CodingKeys: String, CodingKey { + case episodeId = "id" + case feedId, title, description, datePublished, enclosureUrl + case enclosureType, duration, image, episode, season + case episodeGuid, chaptersUrl, social + } } /// Response from `xyz.effem.search.episodes`. @@ -78,6 +91,11 @@ public struct PodcastCategory: Codable, Sendable, Identifiable { public let name: String public var id: Int { categoryId } + + enum CodingKeys: String, CodingKey { + case categoryId = "id" + case name + } } /// Response from `xyz.effem.podcast.getCategories`. @@ -90,7 +108,7 @@ public struct CategoriesResponse: Codable, Sendable { public struct RecentEpisodesResponse: Codable, Sendable { public let items: [EpisodeResult] public let count: Int? - public let max: Int? + public let max: String? } /// Podcast Index network statistics.