-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Splitting the Publication model #122
Comments
I understand the idea behind this proposal, but I have mixed feelings:
Things are easier than they look right now because locally we mostly deal with packaged publications and remote publications are mostly limited to OPDS. As we blur the line between these two, I don't think that the distinction will be that easy. |
Actually, the idea is that
I guess OPDS 1.x entries are parsed into the RWPM model, so it would make sense to use
I was not aware of this possibility. What are resources and readingOrder supposed to be used for? Should an OPDS entry directly be used as a publication in some cases? |
Yes they can be directly be used as a publication in certain cases.
Which could become problematic for the case explained above. |
Sorry I might have been ambiguous by citing the RWPM, but basically the separation we're suggesting is between:
Now we might argue about how to name what. We could keep Any format would be converted into a Which means that for the "in-between" OPDS entry, it would be first parsed as a let opdsEntry: OPDSPublication = opds.parseEntry(entryURL)
// Create the Publication from a Manifest
let publication = streamer.open(opdsEntry)
navigator.present(publication) But when opening a local EPUB: // Create the Publication directly from a path
let publication = streamer.open(at: File("path/to/epub")) |
Why would you consider the metadata to be mutable while the We can "freeze" the publication at a specific state, but we'll need the ability to easily update it as well.
let opdsEntry: OPDSPublication = opds.parseEntry(entryURL)
// Create the Publication from a Manifest
let publication = streamer.open(opdsEntry)
navigator.present(publication) So, in this example I don't know how I feel about this though since an |
No that's not what I meant, maybe this schema will help:
Actually I'm not so sure that Do you have a more precise use case for that? Nothing prevents from creating a copy of the publication.updateFrom(url) -> Publication
Yes that's right. If there's a need for helpers at the Manifest level, maybe we need to rethink the Services. But for the problem at hand, the question is how do we transition from having just the publication metadata to a full-fledged presentable publication? Loading full |
Here's a proposal to answer this issue: #137 |
There are a number of issues with the current
Publication
model (at least in the mobile toolkit):shared
when deserializing a JSON model (OPDS, RWPM)streamer
when parsing a publication (including RWPM-based publications like DiViNa)The second case needs much more than just a bunch of metadata, such as a position list or a search service, which depend on an associated
Fetcher
. All of this doesn't make sense for an OPDS entry.The need to keep the
Publication
model lightweight for OPDS means that the other associated objects created during the parsing of a publication are not joined in a cohesive object. The parser returns aPubBox(Publication, Fetcher)
and a closure to be called later when the DRM is unlocked, to update thePublication
. This leads to confusing code in the reading apps.@qnga suggested a different approach which I think makes a lot of sense:
Manifest
type that is a pure immutable data object representing strictly a RWPM.Publication
the owner of all the associated objects (goodbyePubBox
):Manifest
Fetcher
Manifest
instead of aPublication
.We could also add a typealias
OPDSPublication = Manifest
, to have a nicer API for the OPDS parser.I believe that we can implement this without breaking the reading apps, by doing some aliases with deprecation warnings in the
Publication
object.The text was updated successfully, but these errors were encountered: