@@ -35,12 +35,14 @@ public struct MediaGroup {
35
35
contents: [ MediaContent ] ? = nil ,
36
36
credits: [ MediaCredit ] ? = nil ,
37
37
category: MediaCategory ? = nil ,
38
- rating: MediaRating ? = nil
38
+ rating: MediaRating ? = nil ,
39
+ description: MediaDescription ? = nil
39
40
) {
40
41
self . contents = contents
41
42
self . credits = credits
42
43
self . category = category
43
44
self . rating = rating
45
+ self . description = description
44
46
}
45
47
46
48
// MARK: Public
@@ -68,6 +70,10 @@ public struct MediaGroup {
68
70
/// included, it assumes that no restrictions are necessary. It has one
69
71
/// optional attribute.
70
72
public var rating : MediaRating ?
73
+
74
+ /// Short description describing the media object typically a sentence in
75
+ /// length. It has one optional attribute.
76
+ public var description : MediaDescription ?
71
77
}
72
78
73
79
// MARK: - Sendable
@@ -90,6 +96,7 @@ extension MediaGroup: Codable {
90
96
case credits = " media:credit "
91
97
case category = " media:category "
92
98
case rating = " media:rating "
99
+ case description = " media:description "
93
100
}
94
101
95
102
public init ( from decoder: any Decoder ) throws {
@@ -99,6 +106,7 @@ extension MediaGroup: Codable {
99
106
credits = try container. decodeIfPresent ( [ MediaCredit ] . self, forKey: MediaGroup . CodingKeys. credits)
100
107
category = try container. decodeIfPresent ( MediaCategory . self, forKey: MediaGroup . CodingKeys. category)
101
108
rating = try container. decodeIfPresent ( MediaRating . self, forKey: MediaGroup . CodingKeys. rating)
109
+ description = try container. decodeIfPresent ( MediaDescription . self, forKey: MediaGroup . CodingKeys. description)
102
110
}
103
111
104
112
public func encode( to encoder: any Encoder ) throws {
@@ -108,5 +116,6 @@ extension MediaGroup: Codable {
108
116
try container. encodeIfPresent ( credits, forKey: MediaGroup . CodingKeys. credits)
109
117
try container. encodeIfPresent ( category, forKey: MediaGroup . CodingKeys. category)
110
118
try container. encodeIfPresent ( rating, forKey: MediaGroup . CodingKeys. rating)
119
+ try container. encodeIfPresent ( description, forKey: MediaGroup . CodingKeys. description)
111
120
}
112
121
}
0 commit comments