Skip to content

Commit eae345c

Browse files
committed
Don't require a self link when parsing a RWPM
1 parent 00efcc9 commit eae345c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. Take a look
44

55
**Warning:** Features marked as *alpha* may change or be removed in a future release without notice. Use with caution.
66

7-
<!-- ## [Unreleased] -->
7+
## [Unreleased]
8+
9+
### Changed
10+
11+
#### Streamer
12+
13+
* A `self` link is not required anymore when parsing a RWPM.
14+
815

916
## [3.1.0]
1017

Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift

+11-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ public class ReadiumWebPubParser: PublicationParser, Loggable {
5555

5656
return await resource.readAsRWPM(warnings: warnings)
5757
.flatMap { manifest in
58-
guard let baseURL = manifest.baseURL else {
59-
return .failure(.decoding("No valid self link found in the manifest"))
58+
let baseURL = manifest.baseURL
59+
if baseURL == nil {
60+
warnings?.log(RWPMWarning(message: "No valid self link found in the manifest", severity: .moderate))
6061
}
6162

6263
return .success(CompositeContainer(
@@ -165,3 +166,11 @@ private extension Streamable {
165166
}
166167
}
167168
}
169+
170+
/// Warning raised when parsing a RWPM.
171+
public struct RWPMWarning: Warning {
172+
public let message: String
173+
public let severity: WarningSeverityLevel
174+
175+
public var tag: String { "rwpm" }
176+
}

0 commit comments

Comments
 (0)