File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
main/java/org/readium/r2/streamer/parser/epub
test/resources/org/readium/r2/streamer/parser/epub/package Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -196,10 +196,11 @@ internal class PubMetadataAdapter(
196196 val identifier: String?
197197
198198 init {
199- val identifiers = items[Vocabularies .DCTERMS + " identifier" ]
200- ?.associate { Pair (it.property, it.value) }.orEmpty()
199+ val identifiers = items[Vocabularies .DCTERMS + " identifier" ].orEmpty()
201200
202- identifier = uniqueIdentifierId?.let { identifiers[it] } ? : identifiers.values.firstOrNull()
201+ identifier = uniqueIdentifierId
202+ ?.let { uniqueId -> identifiers.firstOrNull { it.id == uniqueId }?.value }
203+ ? : identifiers.firstOrNull()?.value
203204 }
204205
205206 val published = firstValue(Vocabularies .DCTERMS + " date" )?.iso8601ToDate()
Original file line number Diff line number Diff line change 33 <metadata xmlns : dc =" http://purl.org/dc/elements/1.1/" >
44 <dc : title >Alice's Adventures in Wonderland</dc : title >
55 <dc : identifier > </dc : identifier >
6- <dc : identifier id = " isbn " >978-3-16-148410-0 </dc : identifier >
6+ <dc : identifier >BEQ </dc : identifier >
77 <dc : identifier id =" pub-id" >urn:uuid:2</dc : identifier >
8+ <dc : identifier id =" isbn" >978-3-16-148410-0</dc : identifier >
89 </metadata >
910 <manifest >
1011 <item id =" titlepage" href =" titlepage.xhtml" media-type =" application/xhtml+xml" />
You can’t perform that action at this time.
0 commit comments