kiwilan / php-opds Goto Github PK
View Code? Open in Web Editor NEWPHP package to create OPDS feed (Open Publication Distribution System) for eBooks.
Home Page: https://packagist.org/packages/kiwilan/php-opds
License: MIT License
PHP package to create OPDS feed (Open Publication Distribution System) for eBooks.
Home Page: https://packagist.org/packages/kiwilan/php-opds
License: MIT License
I've been trying to find a good way to extend/replace the OpdsPaginator() so that it can generate the right output in json() or xml() without messing up the feeds in paginate() or using the wrong route(), but I can't seem to find it without some major code surgery.
Ideally I'd like to pass along the actual total, items per page and current page, perhaps with some callback to generate the right route for first/previous/next/last links, and then let json() and/or xml() do its work to generate the correct feed links.
Maybe we could have a public paginate() method in Opds() that could handle that, and not call some protected paginate() inside OpdsEngine()->feed() ?
Try to paginate
1.0.30
8.2
Linux
No response
I tried running json schema validation tests on the OPDS 2.0 output, but they failed whenever publications were included.
Reason is that the 'modified' property should be of type 'string' format 'date-time' like 2018-11-13T20:20:39+00:00
But it's actually an object in the JSON output: {"date":"2012-03-03 19:47:50.000000","timezone_type":1,"timezone":"+00:00"}
See https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times for details.
OPDS validation error{
"/publications/0/metadata/modified": [
"The data (object) must match the type: string"
]
}
Try to validate the OPDS 2.0 output against the JSON schema using opis/json-schema
or some other validator
1.0.23
8.2
Linux
No response
When you have your own URL scheme that includes an URL parameter called 'page', and you configure Opds with usePaginator = false, OpdsPaginator is still created, and it still checks the query parameters to see if 'page' is there and is an int.
Hint: it's not (always) for COPS :-)
I would expect php-opds not to create a paginator, or at least not to choke on any URL param it has no business checking out.
Or as a fall-back measure, to be able to specify 'this-param-does-not-exist' in OpdsConfig, as the fake page param it should check out instead.
Hint: COPS uses 'n' as actual page param, so someday it might be nice to be able to configure that in php-opds...
PHP Fatal error: Uncaught TypeError: Kiwilan\\Opds\\Engine\\OpdsPaginator::__construct(): Argument #8 ($page) must be of type int, string given, called in ./vendor/kiwilan/php-opds/src/Engine/OpdsPaginator.php on line 48 and defined in ./vendor/kiwilan/php-opds/src/Engine/OpdsPaginator.php:15
Stack trace:
#0 ./vendor/kiwilan/php-opds/src/Engine/OpdsPaginator.php(48): Kiwilan\\Opds\\Engine\\OpdsPaginator->__construct()
#1 ./vendor/kiwilan/php-opds/src/Engine/OpdsEngine.php(245): Kiwilan\\Opds\\Engine\\OpdsPaginator::make()
#2 ./vendor/kiwilan/php-opds/src/Engine/OpdsJsonEngine.php(68): Kiwilan\\Opds\\Engine\\OpdsEngine->paginate()
#3 ./vendor/kiwilan/php-opds/src/Engine/OpdsJsonEngine.php(23): Kiwilan\\Opds\\Engine\\OpdsJsonEngine->feed()
#4 ./vendor/kiwilan/php-opds/src/Opds.php(122): Kiwilan\\Opds\\Engine\\OpdsJsonEngine::make()
#5 ./lib/Output/KiwilanOPDS.php(191): Kiwilan\\Opds\\Opds->get()
#6 ./opds.php(47): SebLucas\\Cops\\Output\\KiwilanOPDS->render()
#7 {main}
thrown in ./vendor/kiwilan/php-opds/src/Engine/OpdsPaginator.php on line 15
Try OPDS feed with URL parameter ?page=index
1.0.1
8.2
Linux
Not sure what it actually does with an 'int' page, but it doesn't seem to bother it after that...
I might as well post this one too while I'm reporting issues :-)
As the title says, OpdsEntryBook expects 'volume' to be int
, but Calibre actually uses float
to cover series indexes like 1.25
And the OPDS 2.0 draft states that the 'position' it is converted to can be either an integer or a float:
https://github.com/readium/webpub-manifest/tree/master/contexts/default
which translates to type 'number' in json schema:
https://json-schema.org/understanding-json-schema/reference/numeric.html#number
Try to use calibre series_index for volume
1.0.23
8.2
Linux
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.