File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Modules/Sources/ParsingClient/Parsers Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -171,13 +171,15 @@ public struct TopicParser {
171171 throw ParsingError . unknownAttachmentType ( type)
172172 }
173173
174+ let downloadCount = ( attachment [ safe: 7 ] as? Int ) ?? ( attachment [ safe: 4 ] as? Int )
175+
174176 let attachment = Post . Attachment (
175177 id: id,
176178 type: type,
177179 name: name,
178180 size: size,
179181 metadata: try parseAttachmentMetadata ( attachment) ,
180- downloadCount: attachment [ safe : 7 ] as? Int // Only if attachment.count > 7
182+ downloadCount: downloadCount // Only if attachment.count > 7
181183 )
182184 attachments. append ( attachment)
183185 }
@@ -187,7 +189,7 @@ public struct TopicParser {
187189 // MARK: - Attachment Metadata
188190
189191 private static func parseAttachmentMetadata( _ attachment: [ Any ] ) throws ( ParsingError) -> Post . Attachment . Metadata ? {
190- if attachment. count <= 4 {
192+ if attachment. count <= 5 {
191193 return nil
192194 }
193195
You can’t perform that action at this time.
0 commit comments