From 2b820b79d2146bd323bfc356a93848130eeac482 Mon Sep 17 00:00:00 2001 From: Calin Tataru Date: Sun, 15 Mar 2026 21:03:44 +0000 Subject: [PATCH] Add images property to Person struct --- Sources/TraktKit/Models/People/Person.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/TraktKit/Models/People/Person.swift b/Sources/TraktKit/Models/People/Person.swift index cef0e2f..14a9cb5 100644 --- a/Sources/TraktKit/Models/People/Person.swift +++ b/Sources/TraktKit/Models/People/Person.swift @@ -20,21 +20,27 @@ public struct Person: TraktObject { public let birthplace: String? public let homepage: URL? + // Extended: Images + public let images: TraktImages? + enum CodingKeys: String, CodingKey { case name case ids - + case biography case birthday case death case birthplace case homepage + + case images } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decode(String.self, forKey: CodingKeys.name) ids = try container.decode(ID.self, forKey: CodingKeys.ids) + biography = try container.decodeIfPresent(String.self, forKey: CodingKeys.biography) birthday = try container.decodeIfPresent(Date.self, forKey: CodingKeys.birthday) death = try container.decodeIfPresent(Date.self, forKey: CodingKeys.death) @@ -44,6 +50,8 @@ public struct Person: TraktObject { } catch { homepage = nil } + + images = try container.decodeIfPresent(TraktImages.self, forKey: .images) } }