Skip to content

Commit

Permalink
Rename archive Link property (readium#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu committed May 14, 2024
1 parent 091f9ac commit 5ac1b6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ All notable changes to this project will be documented in this file. Take a look

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

#### Shared

* 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`.

#### LCP

* [#493](https://github.com/readium/kotlin-toolkit/discussions/493) The LCP module does not require the Bluetooth permissions anymore to derive the device name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public data class ArchiveProperties(
}
}

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

public val Resource.Properties.archive: ArchiveProperties?
get() = (this[ARCHIVE_KEY] as? Map<*, *>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PropertiesTest {
ArchiveProperties(entryLength = 8273, isEntryCompressed = true),
Resource.Properties(
mapOf(
"archive" to mapOf(
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
"entryLength" to 8273,
"isEntryCompressed" to true
)
Expand All @@ -38,7 +38,7 @@ class PropertiesTest {
assertNull(
Resource.Properties(
mapOf(
"archive" to mapOf(
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
"foo" to "bar"
)
)
Expand All @@ -51,7 +51,7 @@ class PropertiesTest {
assertNull(
Resource.Properties(
mapOf(
"archive" to mapOf(
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
"isEntryCompressed" to true
)
)
Expand All @@ -61,7 +61,7 @@ class PropertiesTest {
assertNull(
Resource.Properties(
mapOf(
"archive" to mapOf(
"https://readium.org/webpub-manifest/properties#archive" to mapOf(
"entryLength" to 8273
)
)
Expand Down

0 comments on commit 5ac1b6d

Please sign in to comment.