Skip to content

Commit 07f3a99

Browse files
committed
Parse feed identifier
1 parent 343c3ae commit 07f3a99

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

Sources/OPDS/OPDS1Parser.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public class OPDS1Parser: Loggable {
9393
}
9494
let feed = Feed(title: title)
9595

96+
feed.metadata.identifier = root.firstChild(tag: "id")?.stringValue
97+
9698
if let tmpDate = root.firstChild(tag: "updated")?.stringValue,
9799
let date = tmpDate.dateFromISO8601
98100
{

Sources/Shared/OPDS/OpdsMetadata.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Foundation
99
/// OPDS metadata properties.
1010
public class OpdsMetadata {
1111
public var title: String
12+
public var identifier: String?
1213
public var numberOfItem: Int?
1314
public var itemsPerPage: Int?
1415
public var currentPage: Int?

Tests/OPDSTests/readium_opds1_1_test.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class readium_opds1_1_test: XCTestCase {
4646
}
4747

4848
func testMetadata() {
49+
XCTAssert(feed!.metadata.identifier == "urn:uuid:433a5d6a-0b8c-4933-af65-4ca4f02763eb")
4950
XCTAssert(feed!.metadata.title == "Unpopular Publications")
5051
// TODO: add more tests...
5152
}

0 commit comments

Comments
 (0)