Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/OPDS/OPDS1Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public class OPDS1Parser: Loggable {
}
let feed = Feed(title: title)

feed.metadata.identifier = root.firstChild(tag: "id")?.stringValue

if let tmpDate = root.firstChild(tag: "updated")?.stringValue,
let date = tmpDate.dateFromISO8601
{
Expand Down
1 change: 1 addition & 0 deletions Sources/Shared/OPDS/OpdsMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation
/// OPDS metadata properties.
public class OpdsMetadata {
public var title: String
public var identifier: String?
public var numberOfItem: Int?
public var itemsPerPage: Int?
public var currentPage: Int?
Expand Down
1 change: 1 addition & 0 deletions Tests/OPDSTests/readium_opds1_1_test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class readium_opds1_1_test: XCTestCase {
}

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