diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dcef12dc..dc0d3b992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. Take a look **Warning:** Features marked as *alpha* may change or be removed in a future release without notice. Use with caution. - +## [Unreleased] + +### Changed + +#### Streamer + +* A `self` link is not required anymore when parsing a RWPM. + ## [3.1.0] diff --git a/Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift b/Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift index a9446ccca..7b729f1a6 100644 --- a/Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift +++ b/Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift @@ -55,8 +55,9 @@ public class ReadiumWebPubParser: PublicationParser, Loggable { return await resource.readAsRWPM(warnings: warnings) .flatMap { manifest in - guard let baseURL = manifest.baseURL else { - return .failure(.decoding("No valid self link found in the manifest")) + let baseURL = manifest.baseURL + if baseURL == nil { + warnings?.log(RWPMWarning(message: "No valid self link found in the manifest", severity: .moderate)) } return .success(CompositeContainer( @@ -165,3 +166,11 @@ private extension Streamable { } } } + +/// Warning raised when parsing a RWPM. +public struct RWPMWarning: Warning { + public let message: String + public let severity: WarningSeverityLevel + + public var tag: String { "rwpm" } +}