-
Notifications
You must be signed in to change notification settings - Fork 41
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
file_opds Nextcloud14 compatibility #109
base: master
Are you sure you want to change the base?
Conversation
…ew (application/comicbook+rar)
Hi, |
Hi @hcharbonnier , seems to work on the server. Got to check it in an ebook reader. But many thanks so far. |
On chunky reader on IPAD, it works (pdf, cbz, cbr). |
It works on Moon+ Reader on Android. Many thanks for fixing this. |
Please note that Nextcloud 15 has been released. Hopefully this is still compatible but will need the max version bumped in info.xml. |
Config::set('id', Util::genUuid()); | ||
|
||
\OCP\JSON::success( | ||
\OC_JSON::success( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for now, but it is internal API, which might break at any point in time. Best is to move away from this style over to a app framework based controller, that can accomplish the same: https://docs.nextcloud.com/server/stable/developer_manual/app/requests/controllers.html
@@ -64,7 +64,7 @@ public static function isValid($meta) { | |||
protected static function load($id) { | |||
$sql = 'SELECT * FROM `*PREFIX*opds_metadata` WHERE id = ?'; | |||
$args = array($id); | |||
$query = \OCP\DB::prepare($sql); | |||
$query = \OC_DB::prepare($sql); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this. This is internal API now, that can change at any point in time. Best is to use the DB connection: https://github.com/nextcloud/server/pull/8985/files#diff-47cd1c326a2fae00c6f0e1e088c994bbL430 and there the query builder is currently the way to go: https://docs.nextcloud.com/server/stable/developer_manual/app/storage/database.html (there is one more abstraction layer in the docs: the mapper and entities - you don't need them, but inside them is basically all the DB logic that you need and then your code is better separated. You could use the DB access also without mapper and entity - it's just a best practice here)
Updated for Nextcloud 16 now. |
This should fix files_opds app in nextcloud 14