From fb262867ae73ae1761596701a030a2db2648b5d5 Mon Sep 17 00:00:00 2001 From: Nuno Dias Date: Sat, 15 Feb 2025 08:31:11 +0100 Subject: [PATCH] Make itunes:episode of type String #171 --- Sources/FeedKit/Namespaces/iTunes/ITunes.swift | 6 +++--- Tests/FeedKitTests/Tests/iTunesTests + Mocks.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/FeedKit/Namespaces/iTunes/ITunes.swift b/Sources/FeedKit/Namespaces/iTunes/ITunes.swift index c9f3c55..a5cc9c9 100644 --- a/Sources/FeedKit/Namespaces/iTunes/ITunes.swift +++ b/Sources/FeedKit/Namespaces/iTunes/ITunes.swift @@ -48,7 +48,7 @@ public struct ITunes { type: String? = nil, episodeType: String? = nil, season: Int? = nil, - episode: Int? = nil + episode: String? = nil ) { self.author = author self.block = block @@ -284,7 +284,7 @@ public struct ITunes { /// Use the tag in conjunction with the tag /// to indicate the order an episode should be presented within a season. - public var episode: Int? + public var episode: String? } // MARK: - XMLNamespaceDecodable @@ -349,7 +349,7 @@ extension ITunes: Codable { type = try container.decodeIfPresent(String.self, forKey: CodingKeys.type) episodeType = try container.decodeIfPresent(String.self, forKey: CodingKeys.episodeType) season = try container.decodeIfPresent(Int.self, forKey: CodingKeys.season) - episode = try container.decodeIfPresent(Int.self, forKey: CodingKeys.episode) + episode = try container.decodeIfPresent(String.self, forKey: CodingKeys.episode) } public func encode(to encoder: any Encoder) throws { diff --git a/Tests/FeedKitTests/Tests/iTunesTests + Mocks.swift b/Tests/FeedKitTests/Tests/iTunesTests + Mocks.swift index 6a48711..f95bda3 100644 --- a/Tests/FeedKitTests/Tests/iTunesTests + Mocks.swift +++ b/Tests/FeedKitTests/Tests/iTunesTests + Mocks.swift @@ -48,7 +48,7 @@ extension iTunesTests { keywords: "Persia, Achaemenid, Xerxes, Darius, Artaxerxes, Greek, Macedonian, ancient history, military, Philip, Alexander, Spartan, Athens, Herodotus, Leonidas, podcast, Plataea, Issus, Salamis, Gaugamela", episodeType: "full", season: 3, - episode: 2 + episode: "2" ) ) ],