Skip to content

Commit

Permalink
Merge bugfixes into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sbertix committed May 8, 2021
2 parents 0f356cf + d587288 commit 0b3aef4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/Swiftagram/Models/Specialized/Section.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ public struct Section: Wrapped {
public var wrapper: () -> Wrapper

/// Media in the response.
public var items: [Media]? { self["layoutContent"].medias.array()?.compactMap(Media.init) }
public var items: [Media]? {
self["layoutContent"]
.fillItems
.array()?
.compactMap { $0.media.optional().flatMap(Media.init) }
?? self["layoutContent"]
.medias
.array()?
.compactMap { $0.media.optional().flatMap(Media.init) }
}

/// Init.
/// - parameter wrapper: A valid `Wrapper`.
Expand Down

0 comments on commit 0b3aef4

Please sign in to comment.