Closed ewilan-riviere closed 1 year ago
Patch coverage is 44.93%
of modified lines.
Files Changed | Coverage |
---|---|
src/OpdsConfig.php | 0.00% |
src/Engine/OpdsJsonEngine.php | 31.57% |
src/Engine/OpdsXmlEngine.php | 33.33% |
src/Opds.php | 60.00% |
src/OpdsResponse.php | 80.00% |
src/Engine/OpdsEngine.php | 96.66% |
src/Entries/OpdsEntryBook.php | 100.00% |
:loudspeaker: Thoughts on this report? Let us know!.
@mikespub Do you want to beta-test 1.0.0
with partial JSON support?
I can give it a go in my kiwilan branch but what do you mean by "partial support"? If it doesn't generate a complete OPDS 2.0 feed yet, then I'm afraid it won't be very helpful at this point...
With the pre-1.0 version I simply rewrote the OPDS renderer to make use of Kiwilan\Opds to render the XML output based on the entries passed by $page: lib/Output/KiwilanOPDS.php
And the new entrypoint opds.php was a straight copy of the existing feed.php, calling $OPDSRender->render($page, $request) and echo-ing the response.
That worked out nicely to generate the same OPDS 1.2 output as the existing renderer, so I was hoping I could use a similar approach when switching to OPDS 2.0 output: use a library that already generates OPDS 2.0-compliant output for different collections and feeds as defined in the specs, and then see how best to map/adapt the COPS page structure to generate meaningful COPS feeds.
Right now 1.0.0-alpha.1 still seems to be missing some of the building blocks, or maybe I missed something?
One last point for future versions: for a re-usable package, it would be easier if we could get back the output as a result so we can handle the response ourselves afterwards, rather than let OPDSResponse->get() handle it.
Thanks
This version don't support facets, groups and pagination.
Pagination will be first feature planned. For metadata, this version partially support with just basics entries, for metadata into belongsTo entry, just series supported for now.
One last point for future versions: for a re-usable package, it would be easier if we could get back the output as a result so we can handle the response ourselves afterwards, rather than let OPDSResponse->get() handle it.
I update Opds::class
, now you can use get()
method to get full instance with generated response into getResponse()
. Method response()
is available to send response to browser.
If you want to test OPDS 2.0 only when is full ready, I will send you a notification when all is done.
Thanks Ewilan, I would indeed prefer to wait for a more complete version before testing - sorry about that.
I've spent quite some time dragging the COPS code base from PHP 5.x to PHP 8.x, and adding OPDS 2.0 would be nice to have, so after dealing with a bunch of resource packages that hadn't been updated in 8 years, I was excited to find a modern package I could re-use that might provide that in the future :-)
This version rework completely the library, it's not compatible with previous version. Now you can use OPDS 2.0 with partial support.
BREAKING CHANGES
Opds::class
response()
removed, now static method isOpds::make()
andget()
is a arrow method:entries
, you have to usefeeds()
arrow methodfeeds()
acceptOpdsEntryBook[]
orOpdsEntryNavigation[]
but alsoOpdsEntryNavigation
orOpdsEntryBook
isSearch
, you have to useisSearch()
arrow methodtitle
, you have to usetitle()
arrow methodurl
, you have to useurl()
arrow method (only for testing, URL is automatically generated)version
:?version=2.0
or?version=1.2
Opds::class
instance, you can useget()
arrow methodresponse()
arrow methodasString
param removed, now you can useget()
arrow method to debug responseget()
you can usegetResponse()
arrow method (different thatresponse()
will return full content asnever
with headers)Misc
OpdsConfig
usePagination
is now default tofalse
forceJson
param allow to skip OPDS 1.2OpdsEntry
is nowOpdsEntryNavigation
OpdsEngine
rewrite completelyOpdsResponse
can be debug withgetContent()
method to inspect response (accessible if you useget()
method)OpdsEntry
items have nowget
prefix for all getterAdded