Are there guidelines/best practices for using Readium Locators with OPDS? #67
-
For some context: I'm developing an e-paper based eReader and I'm exploring methods to sync reading progression on the physical device to a remote server. Ideally, the reading progression on my custom eReader could sync with other OPDS compatible clients like Thorium Reader, Aldiko, etc. It looks like I can do this with OPDS but I have questions. I've read the discussions on the proposed synchronization service in this repo and the related discussions in the readium repo and OPDS-PSE repo as well. It sounds like ODPS 2.0 will do what OPDS-PSE did for OPDS 1.X, and more. I'm new to the world of publication distribution, but I read the OPDS 1.2 spec, the OPDS 2.0 spec, the Readium Web Publication Manifest, and read through the Readium Architecture docs and found (very brief) reference to Locator Objects in the Navigator Docs , the Positions List docs, and, indirectly, in the Publication Server docs since that references the Position List API. If I'm reading the docs correctly, Locator Objects should only be used in Positions Lists and must be implemented by "Level 2" Publication Servers. I can think of several ways to use Locator Objects to sync reading progression between my custom eReader and a remote server, but I'm unsure if there is canonical way to do this so that other OPDS 2.0 compliant clients can also be aware of that reading progress. Also there appears to be no locations in the 2.0 schema I've stumbled on. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
We don't have any official document for synchronizing a publication's reading position through OPDS yet. However, we implemented just that in Aldiko, using This works with a dedicated web service, discoverable as a link in an OPDS publication. Progression APIThe progression API is meant to synchronize the current progression in a publication between reading apps and an OPDS catalog. Progression DocumentThis API is built on top of the Locator model, as defined in the Readium Architecture: https://readium.org/architecture/models/locators/ Both the reading app (client) and OPDS catalog (server) exchange a single Progression Object at a time that represents the current progression in a publication. Progression Object
Device Object
ExamplesExample 1: Progression document for an EPUB {
"modified": "2022-02-08T17:00:00Z",
"device": {
"id": "6288f156-3c2d-41de-83f4-b085e40361e7",
"name": "Pixel 5"
},
"locator": {
"title": "Chapter 1",
"href": "chapter_1.xhtml",
"type": "application/xhtml+xml",
"locations": {
"position": 4,
"progression": 0.03401,
"totalProgression": 0.01349
}
}
} Example 2: Progression document for a PDF {
"modified": "2022-02-08T17:00:00Z",
"device": {
"id": "6288f156-3c2d-41de-83f4-b085e40361e7",
"name": "Pixel 5"
},
"locator": {
"title": "Chapter 1",
"href": "book.pdf",
"type": "application/pdf",
"locations": {
"fragments": ["page=4"],
"position": 4,
"progression": 0.01349,
"totalProgression": 0.01349
}
}
} Example 3: Progression document for an audiobook {
"modified": "2022-01-28T15:00:00Z",
"device": {
"id": "96492da5-53c2-42dc-9c27-bc17d2b2cb7c",
"name": "Connected Tea Kettle"
},
"locator": {
"title": "Chapter 5",
"href": "track6.mp3",
"type": "audio/mpeg",
"locations": {
"fragments": ["t=389.84"],
"progression": 0.607379,
"totalProgression": 0.50678
}
}
} Service DiscoveryThe Progression API can be identified through the links of an OPDS 2.0 publication: {
"href": "https://example.com/publication/1/position",
"type": "application/vnd.readium.progression+json",
"rel": "http://www.cantook.com/api/progression"
} Since interacting with the Progression API will always require authentication, it is highly recommended to include the {
"href": "https://example.com/publication/1/position",
"type": "application/vnd.readium.progression+json",
"rel": "http://www.cantook.com/api/progression",
"properties": {
"authenticate": {
"href": "https://example.com/authentication.json",
"type": "application/opds-authentication+json"
}
}
} InteractionsRequesting the last-known progression
Successful response
Updating the last-known progression
Successful response
Failure modes For all failure modes, the payload will return a Problem Details JSON object along with
Appendix A - JSON Schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Progression API",
"properties": {
"modified": {
"type": "string",
"format": "date-time"
},
"device": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
},
"locator": {
"$ref": "https://readium.org/architecture/schema/locator.schema.json"
}
},
"required": [
"modified",
"device",
"locator"
]
} |
Beta Was this translation helpful? Give feedback.
At present, there is no plan to add it to OPDS, but that could change if there is sufficient interest from stakeholders.
This is an internal specification, so we used the
cantook.com
domain. Even though the page is a 404, it doesn't matter; it simply serves as a unique identifier for the error type.