Skip to content

Commit 5ac1b6d

Browse files
authored
Rename archive Link property (readium#514)
1 parent 091f9ac commit 5ac1b6d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ All notable changes to this project will be documented in this file. Take a look
1616

1717
* All the APIs using or returning a `Date` objects are now using a custom `Instant` type.
1818

19+
#### Shared
20+
21+
* The `Link` property key for archive-based publication assets (e.g. an EPUB/ZIP) is now `https://readium.org/webpub-manifest/properties#archive` instead of `archive`.
22+
1923
#### LCP
2024

2125
* [#493](https://github.com/readium/kotlin-toolkit/discussions/493) The LCP module does not require the Bluetooth permissions anymore to derive the device name.

readium/shared/src/main/java/org/readium/r2/shared/util/archive/ArchiveProperties.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public data class ArchiveProperties(
4848
}
4949
}
5050

51-
private const val ARCHIVE_KEY = "archive"
51+
private const val ARCHIVE_KEY = "https://readium.org/webpub-manifest/properties#archive"
5252

5353
public val Resource.Properties.archive: ArchiveProperties?
5454
get() = (this[ARCHIVE_KEY] as? Map<*, *>)

readium/shared/src/test/java/org/readium/r2/shared/util/resource/PropertiesTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PropertiesTest {
2424
ArchiveProperties(entryLength = 8273, isEntryCompressed = true),
2525
Resource.Properties(
2626
mapOf(
27-
"archive" to mapOf(
27+
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
2828
"entryLength" to 8273,
2929
"isEntryCompressed" to true
3030
)
@@ -38,7 +38,7 @@ class PropertiesTest {
3838
assertNull(
3939
Resource.Properties(
4040
mapOf(
41-
"archive" to mapOf(
41+
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
4242
"foo" to "bar"
4343
)
4444
)
@@ -51,7 +51,7 @@ class PropertiesTest {
5151
assertNull(
5252
Resource.Properties(
5353
mapOf(
54-
"archive" to mapOf(
54+
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
5555
"isEntryCompressed" to true
5656
)
5757
)
@@ -61,7 +61,7 @@ class PropertiesTest {
6161
assertNull(
6262
Resource.Properties(
6363
mapOf(
64-
"archive" to mapOf(
64+
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
6565
"entryLength" to 8273
6666
)
6767
)

0 commit comments

Comments
 (0)