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
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,11 @@ internal class PubMetadataAdapter(
val identifier: String?

init {
val identifiers = items[Vocabularies.DCTERMS + "identifier"]
?.associate { Pair(it.property, it.value) }.orEmpty()
val identifiers = items[Vocabularies.DCTERMS + "identifier"].orEmpty()

identifier = uniqueIdentifierId?.let { identifiers[it] } ?: identifiers.values.firstOrNull()
identifier = uniqueIdentifierId
?.let { uniqueId -> identifiers.firstOrNull { it.id == uniqueId }?.value }
?: identifiers.firstOrNull()?.value
}

val published = firstValue(Vocabularies.DCTERMS + "date")?.iso8601ToDate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title>Alice's Adventures in Wonderland</dc:title>
<dc:identifier> </dc:identifier>
<dc:identifier id="isbn">978-3-16-148410-0</dc:identifier>
<dc:identifier>BEQ</dc:identifier>
<dc:identifier id="pub-id">urn:uuid:2</dc:identifier>
<dc:identifier id="isbn">978-3-16-148410-0</dc:identifier>
</metadata>
<manifest>
<item id="titlepage" href="titlepage.xhtml" media-type="application/xhtml+xml" />
Expand Down