Skip to content

Commit

Permalink
Make itunes:episode of type String #171
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdias committed Feb 15, 2025
1 parent 0034c02 commit fb26286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Sources/FeedKit/Namespaces/iTunes/ITunes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -284,7 +284,7 @@ public struct ITunes {

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

// MARK: - XMLNamespaceDecodable
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Tests/FeedKitTests/Tests/iTunesTests + Mocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
],
Expand Down

0 comments on commit fb26286

Please sign in to comment.