Is there a documentation about this available?
Edit2: I've started over with another test book and currently it seems to work like expected.
I'm curently trying to enhance the Calibre Wifi connection in koreader. My goal is to see in Calibre which books are already on the reader.
For this I think I have to answer the GET_BOOK_COUNT JSON first with
Code:
[0,{"count":1,"willScan":true,"willStream":true}]
Directly followed by the book, which is on the device:
Code:
[0,{"_last_read_date_":"2015-01-05 01:21:16","_sync_type_":0,"extension":".epub","last_modified":"2015-01-05T01:10:47+00:00","lpath":"TestBook - Sample, Author (129).epub","priKey":1,"uuid":"20f8428b-5502-4d14-9c4a-86d207f59e24"}]
But Calibre throws an exception when doing this:
Code:
calibre, version 2.15.0
FEHLER: Fehler: Fehler bei der Kommunikation mit dem Gerät
'list' object has no attribute 'get'
Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 87, in run
File "site-packages/calibre/gui2/device.py", line 503, in _books
File "site-packages/calibre/devices/smart_device_app/driver.py", line 50, in _synchronizer
File "site-packages/calibre/devices/smart_device_app/driver.py", line 1331, in books
AttributeError: 'list' object has no attribute 'get'
If I don't send the JSON to Calibre I get a timeout in Calibre after some time. During this I receive no other communication from Calibre, so I think the attempt of sending the book information JSON directly is correct.
This is the timeout message from Calibre if I don't send the book information:
Code:
calibre, version 2.15.0
FEHLER: Fehler: Fehler bei der Kommunikation mit dem Gerät
There was a timeout while communicating with the device in function: Device did not respond in reasonable time
Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 87, in run
File "site-packages/calibre/gui2/device.py", line 503, in _books
File "site-packages/calibre/devices/smart_device_app/driver.py", line 50, in _synchronizer
File "site-packages/calibre/devices/smart_device_app/driver.py", line 1260, in books
File "site-packages/calibre/devices/smart_device_app/driver.py", line 644, in _receive_from_client
TimeoutError: There was a timeout while communicating with the device in function: Device did not respond in reasonable time
Edit: I've made some steps forward. The exception occurs because the data in my answer with the book information doesn't seem to match the one that Calibre has cached. Then the NOOP with priKey was answered by a simple OK {} from the reader instead of the updated meta data. It took me awhile to figure this out since NOOP is misleading for requesting the data.
I still can't figure out why my metadata, which I send in the book information doesn't seem to match the cache. I've taken the values directly from the SEND_BOOK JSON at the time the book was send to the device. I've took the uuid, lpath and last_modified from this.