steinarb / opds-reader

A calibre plugin containing an OPDS client that can import books into calibre
GNU General Public License v3.0
48 stars 25 forks source link

Doesn't appear to work with calibre 5 #10

Closed PiperKev closed 4 years ago

PiperKev commented 4 years ago

I just updated my calibre installation to version 5.0.1, and the OPDS Client entry on the main toolbar disappeared. I attempted to reinstall, but it doesn't show as an available action to install on the toolbar.

steinarb commented 4 years ago

PiperKev notifications@github.com:

I just updated my calibre installation to version 5.0.1, and the OPDS Client entry on the main toolbar disappeared. I attempted to reinstall, but it doesn't show as an available action to install on the toolbar.

Indeed!

The button is gone from my toolbar too, so this is something I will need to look into.

Thanks!

PiperKev commented 4 years ago

Could it be a Python issue? Calibre 5.0 uses Python 3 now. I reverted back to 4.23, which uses Python 2, and the OPDS Client button came back.

steinarb commented 4 years ago

Looks like you're right: https://calibre-ebook.com/new-in/fourteen

I will need to move the plugin to python 3.

I wonder how to do that...? It's been a while since I last had to do any work on this plugin...:-)

steinarb commented 4 years ago

I couldn't find anything python 3 specific in the plugin.

I looked at the documentation for plugins with UI and compared with the source code. As far as I can tell the plugins follows the structure.

I've started calibre with "calibre-debug -g" and as far as I can tell calibre picks up the plugin:

sb@mccoy:~/git/opds-reader/calibre_plugin$ calibre-debug -g
calibre 5.0.1 [64bit]  embedded-python: True is64bit: True
Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', 'SP0', 'Multiprocessor Free')
Interface language: en_GB
Successfully initialized third party plugins: OPDS Client (1, 0, 0)
Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 118.41774744027302 x 118.22545454545454
Using calibre Qt style: True
[0.00] Starting up...
[0.27] Showing splash screen...
[17.28] splash screen shown
[17.28] Initializing db...
[21.27] db initialized
[21.27] Constructing main UI...
Failed to load recipe from: 'Aftenposten.no_1002.recipe'
Failed to load recipe from: 'nrk.no_1000.recipe'
[49.64] main UI initialized...
[49.64] Hiding splash screen
Starting QuickView

The plugin also shows up in the plugins section of the Preferences dialog. But it does not show up in "Toolbars & menus" where the opds-reader toolbutton is added to the top menu bar.

I have asked a question on the calibre forums.

steinarb commented 4 years ago

Still not fixed. I get errors when clicking on the button:

calibre, version 5.0.1
ERROR: Unhandled exception: <b>KeyError</b>:'server'

calibre 5.0.1 [64bit]  embedded-python: True is64bit: True
Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', 'SP0', 'Multiprocessor Free')
Interface language: en_GB
Successfully initialized third party plugins: OPDS Client (1, 0, 0)
Traceback (most recent call last):
  File "calibre_plugins.opds_client.ui", line 24, in show_dialog
  File "calibre_plugins.opds_client.main", line 68, in __init__
  File "calibre_plugins.opds_client.model", line 78, in downloadOpdsRootCatalog
KeyError: 'server'
steinarb commented 4 years ago

I have successfully read the OPDS feed of a different calibre instance, downloaded a book, and set the purchase date on that book.

So now the plugin works for me on calibre 5.01.

PiperKev commented 4 years ago

It works on the most recent calibre update, 5.1, as well! Thanks so much for the quick turnaround on this!

steinarb commented 4 years ago

You're welcome! :-)

It helped on the motivation, that I needed this for myself. :-)