Add book format identifier string to the book interface#71
Add book format identifier string to the book interface#71Protected wants to merge 2 commits intojohnfactotum:mainfrom
Conversation
|
I guess it could be convenient in some cases, though I'd prefer if it's a property on the view object. Or rather, whatever it is that actually calls these book object functions; because the type of the file is determined before it is passed to these functions, so they have really very little to do with it. Also, is there any particular reason why you'd use |
|
It's just the equivalent of the read only getter on classes. No serious reason. |
|
Like this, then? |
|
I meant on the View class itself. There's already a somewhat awkward One idea is to turn it into two functions. One for detecting the type, and the other for actually creating the book, given the type. Ultimately, I guess it's not entirely clear what "type" means. If it can be more or less equated with media types, then you likely already have that from the file object or filesystem itself before opening the book. And if a better check than the system-provided media type is needed, then the above idea of separating out a function for detecting the type could work. But in the end, this is just a broad format, not really saying anything about the actual content of the book. For example, a fixed-layout EPUB could be a comic book, and a CBZ could be scans of a non-comic book, and so on. |
It's useful to have a consistent way to identify the book loader associated with the foliate-view, so the external application (the reader, let's call it) can behave differently in response to it.
Some examples:
etc.