Skip to content

Commit fb26286

Browse files
committed
Make itunes:episode of type String #171
1 parent 0034c02 commit fb26286

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/FeedKit/Namespaces/iTunes/ITunes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public struct ITunes {
4848
type: String? = nil,
4949
episodeType: String? = nil,
5050
season: Int? = nil,
51-
episode: Int? = nil
51+
episode: String? = nil
5252
) {
5353
self.author = author
5454
self.block = block
@@ -284,7 +284,7 @@ public struct ITunes {
284284

285285
/// Use the <itunes:episode> tag in conjunction with the <itunes:season> tag
286286
/// to indicate the order an episode should be presented within a season.
287-
public var episode: Int?
287+
public var episode: String?
288288
}
289289

290290
// MARK: - XMLNamespaceDecodable
@@ -349,7 +349,7 @@ extension ITunes: Codable {
349349
type = try container.decodeIfPresent(String.self, forKey: CodingKeys.type)
350350
episodeType = try container.decodeIfPresent(String.self, forKey: CodingKeys.episodeType)
351351
season = try container.decodeIfPresent(Int.self, forKey: CodingKeys.season)
352-
episode = try container.decodeIfPresent(Int.self, forKey: CodingKeys.episode)
352+
episode = try container.decodeIfPresent(String.self, forKey: CodingKeys.episode)
353353
}
354354

355355
public func encode(to encoder: any Encoder) throws {

Tests/FeedKitTests/Tests/iTunesTests + Mocks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension iTunesTests {
4848
keywords: "Persia, Achaemenid, Xerxes, Darius, Artaxerxes, Greek, Macedonian, ancient history, military, Philip, Alexander, Spartan, Athens, Herodotus, Leonidas, podcast, Plataea, Issus, Salamis, Gaugamela",
4949
episodeType: "full",
5050
season: 3,
51-
episode: 2
51+
episode: "2"
5252
)
5353
)
5454
],

0 commit comments

Comments
 (0)