Skip to content

Commit

Permalink
description property name doesn't agree with swiftData
Browse files Browse the repository at this point in the history
  • Loading branch information
radmakr committed Nov 2, 2023
1 parent 1f087bd commit 2b0e095
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/CategoriesResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public struct CategoriesResponse: Codable, Hashable, Sendable {
public let count: Int?

/// Description of the response
public let description: String?
public let categoriesResponseDescription: String?

enum CodingKeys: String, CodingKey {
case responseStatus = "status"
case feeds
case count
case description
case categoriesResponseDescription = "description"
}
}
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/DataResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public struct DataResponse: Codable, Hashable, Sendable {
public let since: Date?

/// Description of the response
public let description: String?
public let dataResponseDescription: String?

/// Value to pass as since parameter to get next batch of data
public let nextSince: Int?
Expand All @@ -40,7 +40,7 @@ public struct DataResponse: Codable, Hashable, Sendable {
case itemCount
case max
case since
case description
case dataResponseDescription = "description"
case nextSince
case data
}
Expand Down
43 changes: 42 additions & 1 deletion Sources/PodcastIndexKit/Models/Episode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public struct Episode: Codable, Hashable, Sendable {

/// The item-level description of the episode.
/// Uses the longer of the possible fields in the feed: <description>, <itunes:summary> and <content:encoded>
public let description: String?
public let episodeDescription: String?

/// The unique identifier for the episode
public let guid: String?
Expand Down Expand Up @@ -131,6 +131,47 @@ public struct Episode: Codable, Hashable, Sendable {
/// Status of the livestream
/// Allowed: ended┃live
public let status: LivestreamStatus?

enum CodingKeys: String, CodingKey {
case id
case title
case link
case episodeDescription = "description"
case guid
case datePublished
case datePublishedPretty
case dateCrawled
case enclosureUrl
case enclosureType
case enclosureLength
case contentLink
case duration
case explicit
case episode
case episodeType
case season
case image
case feedItunesId
case feedImage
case feedId
case feedLanguage
case feedDead
case feedTitle
case feedDuplicateOf
case chaptersUrl
case transcriptUrl
case feedImageUrlHash
case imageUrlHash
case transcripts
case persons
case socialInteract
case value
case soundbite
case soundbites
case startTime
case endTime
case status
}
}

public enum LivestreamStatus: String, Codable, Hashable, Sendable {
Expand Down
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/EpisodeArrayResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct EpisodeArrayResponse: Codable, Hashable, Sendable {
public let query: EpisodeResponsesQuery?

/// Description of the response
public let description: String?
public let episodeArrayResponseDescription: String?

/// Indicates API request status
/// Allowed: true┃false
Expand All @@ -32,7 +32,7 @@ public struct EpisodeArrayResponse: Codable, Hashable, Sendable {
case items
case count
case query
case description
case episodeArrayResponseDescription = "description"
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/EpisodeResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public struct EpisodeResponse: Codable, Hashable, Sendable {
public let episode: Episode?

/// Description of the response
public let description: String?
public let episodeResponseDescription: String?

/// Indicates API request status
/// Allowed: true┃false
Expand All @@ -36,6 +36,6 @@ public struct EpisodeResponse: Codable, Hashable, Sendable {
case guid
case podcastGuid
case episode
case description
case episodeResponseDescription = "description"
}
}
39 changes: 38 additions & 1 deletion Sources/PodcastIndexKit/Models/Podcast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct Podcast: Codable, Hashable, Sendable {

/// The channel-level description
/// Uses the longer of the possible fields in the feed: <description>, <itunes:summary> and <content:encoded>
public let description: String?
public let podcastDescription: String?

/// The channel-level author element.
/// Usually iTunes specific, but could be from another namespace if not present.
Expand Down Expand Up @@ -131,6 +131,43 @@ public struct Podcast: Codable, Hashable, Sendable {
/// Information for donation/funding the podcast.
/// See the [podcast namespace spec](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#funding) for more information.
public let funding: PodcastFunding?

enum CodingKeys: String, CodingKey {
case id
case title
case url
case originalUrl
case link
case podcastDescription = "description"
case author
case ownerName
case image
case artwork
case lastUpdateTime
case lastCrawlTime
case lastParseTime
case lastGoodHttpStatusTime
case lastHttpStatus
case contentType
case itunesId
case generator
case language
case type
case dead
case crawlErrors
case parseErrors
case categories
case locked
case podcastGuid
case episodeCount
case imageUrlHash
case newestItemPubdate
case explicit
case itunesType
case chash
case value
case funding
}
}

public enum PodcastType: Int, Codable, Hashable, Sendable {
Expand Down
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/PodcastArrayResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public struct PodcastArrayResponse: Codable, Hashable, Sendable {
public let query: String?

/// Description of the response
public let description: String?
public let podcastArrayResponseDescription: String?


/// Indicates API request status
Expand All @@ -30,6 +30,6 @@ public struct PodcastArrayResponse: Codable, Hashable, Sendable {
case feeds
case count
case query
case description
case podcastArrayResponseDescription = "description"
}
}
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/PodcastResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public struct PodcastResponse: Codable, Hashable, Sendable {
public let query: PodcastResponsesQuery?

/// Description of the response
public let description: String?
public let podcastResponseDescription: String?

/// Indicates API request status
/// Allowed: true┃false
Expand All @@ -25,7 +25,7 @@ public struct PodcastResponse: Codable, Hashable, Sendable {
case responseStatus = "status"
case feed
case query
case description
case podcastResponseDescription = "description"
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/PubNotifyResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ public struct PubNotifyResponse: Codable, Hashable, Sendable {
private let responseStatus: String?

/// Description of the response
public let description: String?
public let pubNotifyDescription: String?

/// Indicates API request status
/// Allowed: true┃false
Expand All @@ -16,6 +16,6 @@ public struct PubNotifyResponse: Codable, Hashable, Sendable {

enum CodingKeys: String, CodingKey {
case responseStatus = "status"
case description
case pubNotifyDescription = "description"
}
}
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/RandomEpisodeResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public struct RandomEpisodeResponse: Codable, Hashable, Sendable {
public let max: Int?

/// Description of the response
public let description: String?
public let randomEpisodeResponseDescription: String?

/// Indicates API request status
/// Allowed: true┃false
Expand All @@ -28,6 +28,6 @@ public struct RandomEpisodeResponse: Codable, Hashable, Sendable {
case episodes
case count
case max
case description
case randomEpisodeResponseDescription = "description"
}
}
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/SoundbiteArrayResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public struct SoundbiteArrayResponse: Codable, Hashable, Sendable {
public let count: Int?

/// Description of the response
public let description: String?
public let soundbiteArrayResponseDescription: String?

/// List of soundbites matching request
public let items: [Soundbite]?
Expand All @@ -23,7 +23,7 @@ public struct SoundbiteArrayResponse: Codable, Hashable, Sendable {
enum CodingKeys: String, CodingKey {
case responseStatus = "status"
case count
case description
case soundbiteArrayResponseDescription = "description"
case items
}
}
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/StatsResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public struct StatsResponse: Codable, Hashable, Sendable {
public let stats: [StatProperties]?

/// Description of the response
public let description: String?
public let statsResponseDescription: String?

enum CodingKeys: String, CodingKey {
case responseStatus = "status"
case stats
case description
case statsResponseDescription = "description"
}
}
4 changes: 2 additions & 2 deletions Sources/PodcastIndexKit/Models/ValueResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public struct ValueResponse: Codable, Hashable, Sendable {
public let value: Value?

/// Description of the response
public let description: String?
public let valueResponseDescription: String?

enum CodingKeys: String, CodingKey {
case responseStatus = "status"
case query
case value
case description
case valueResponseDescription = "description"
}
}

0 comments on commit 2b0e095

Please sign in to comment.