We have calibre-web set up with accounts that have view restrictions via tags. For example, we would like to sync only books tagged "kids" to some e-readers.
We noticed that some books were not syncing at all. This appears to be due this logic that causes the book to by synced with ChangedEntitlement instead of NewEntitlement:
As a workaround this can be fixed by forcing a full Kobo library sync.
To Reproduce
Steps to reproduce the behaviour:
Set up an account with tag view restrictions and Kobo integration.
Add a book to the library, but make sure it does not have the restricted tag on it.
Sync the kobo device (nothing should sync, this is expected and OK).
Add the restricted tag to the book.
Sync the device again.
Note the book is missing.
Logfile
[2024-01-27 23:10:50,019] INFO {cps.kobo:143} Kobo library sync request received.
[2024-01-27 23:10:50,020] DEBUG {cps.kobo:144} SyncToken: <REDACTED>
[2024-01-27 23:10:50,020] DEBUG {cps.kobo:145} Download link format <REDACTED>
[2024-01-27 23:10:50,031] DEBUG {cps.kobo:204} Books to Sync: 1
[2024-01-27 23:10:50,076] DEBUG {cps.kobo:258} Remaining books to Sync: 0
Expected behavior
When a tag is added, the book will fully sync to the Kobo.
Environment (please complete the following information):
OS: Alpine / Docker
Python version: Python 3.x
Calibre-Web version: 0.6.21
Docker container: LinuxServer:
Special Hardware: In a VM
Browser: NA
Additional context
I'm unsure on how to fix this properly. On a first pass, I don't see any metadata that would allow us to identify that the tag visibility results have changed, and to treat those books as new instead of changed.
Describe the bug/problem
We have calibre-web set up with accounts that have view restrictions via tags. For example, we would like to sync only books tagged "kids" to some e-readers.
We noticed that some books were not syncing at all. This appears to be due this logic that causes the book to by synced with
ChangedEntitlement
instead ofNewEntitlement
:https://github.com/janeczku/calibre-web/blob/977f07364be4f47d9aa50fffc0f7169e1ba9d674/cps/kobo.py#L231-L234
This is easiest to see by uncommenting https://github.com/janeczku/calibre-web/blob/977f07364be4f47d9aa50fffc0f7169e1ba9d674/cps/kobo.py#L326 and noting the sync data is not
NewEntitlement
. If I hack this to always sendNewEntitlement
, the book syncs correctly.As a workaround this can be fixed by forcing a full Kobo library sync.
To Reproduce
Steps to reproduce the behaviour:
Logfile
Expected behavior
When a tag is added, the book will fully sync to the Kobo.
Environment (please complete the following information):
Additional context
I'm unsure on how to fix this properly. On a first pass, I don't see any metadata that would allow us to identify that the tag visibility results have changed, and to treat those books as new instead of changed.