MDChapter
public struct MDChapter
extension MDChapter: Decodable
extension MDChapter: Encodable
Structure representing a manga chapter returned by MangaDex
This is passed in the data property of an MDObject
-
The chapter’s title
Declaration
Swift
public let title: String -
The volume this chapter belongs to, if entered by the uploader
Declaration
Swift
public let volume: String? -
The chapter in the printed manga which corresponds to this chapter
Note
This may benilstring if the uploader did not provide a chapter number (e.g. for oneshots)Declaration
Swift
public let chapter: String? -
The language in which this chapter was translated
Declaration
Swift
public let language: Locale? -
The chapter’s hash, used to fetch the pages when using MangaDex@Home
Declaration
Swift
public let hash: String -
The list of page file names
Use
getPageUrlsto get the list of URLs for these filesDeclaration
Swift
public let pages: [String] -
The list of low resolution page file names
Use
getPageUrlsand set thelowResparameter totrueto get the list of URLs for these filesDeclaration
Swift
public let pagesLowRes: [String] -
The date at which this chapter entry was created on MangaDex
Declaration
Swift
public let createdDate: Date -
The date of the last update made to this chapter entry on MangaDex
Note
This property will benilif the chapter was never modified after being createdDeclaration
Swift
public let updatedDate: Date? -
The date at which this chapter will be or has been published
Note
This may differ from thecreatedDateproperty as scanlation groups might impose delaysDeclaration
Swift
public let publishDate: Date? -
The version of this type of object in the MangaDex API
Declaration
Swift
public let version: Int -
The list of page URLs for this chapter using the specified node
Declaration
Swift
public func getPageUrls(node: MDAtHomeNode, lowRes: Bool = false) -> [URL]Parameters
nodeThe MD@Home node serving the images
lowResWhether to get the low resolution version of the image or not
-
The list of page URLs for this chapter using the specified “official” image server
Declaration
Swift
public func getPageUrls(node: MDImageServer, lowRes: Bool = false) -> [URL]Parameters
nodeThe image server serving the images
lowResWhether to get the low resolution version of the image or not
-
Custom
initimplementation to handle decoding thelanguageattributeDeclaration
Swift
public init(from decoder: Decoder) throws -
Convenience
initused for update endpointsDeclaration
Swift
public init(title: String, volume: String? = nil, chapter: String? = nil, language: Locale, pages: [String], pagesLowRes: [String]) -
Custom
encodeimplementation to handle encoding thelanguageattributeThe MangaDex API does not expect the same thing when encoding an
MDChapteras when decoding it, which makes this a bit awkward. See https://api.mangadex.org/docs.html#operation/put-chapter for more detailsDeclaration
Swift
public func encode(to encoder: Encoder) throws
View on GitHub
MDChapter Structure Reference