Feature: keep c-w shelves in sync with calibre collections#3353
Feature: keep c-w shelves in sync with calibre collections#3353xdgc wants to merge 4 commits intojaneczku:masterfrom
Conversation
The file with all the feature code is a new file, so I forgot to add it.
In some recent evolution (I think?) it became necessary for a task to supply its own app context. That wasn't needed when I wrote the patch initially but is needed now.
|
@OzzieIsaacs bump, please consider this compatibility feature |
|
Calibre collections are series in cw, how this will not cause a loop? If you sync cw shelf in calibre they will appear inside c-w as series, no? |
I'm afraid I don't follow. In Calibre, series and collections are different things. Calibre doesn't have native collections, but the Kobo Utilities and Kindle Collections plugins add it as a custom field ( If you switch to using CW for Kobo sync, you lose that. This feature update allows you to sync |
Oh, now I get it, my bad. |
This adds a new feature to sync Calibre-Web shelves to Calibre Collections. This can run ad hoc from a user's personal settings page OR as a scheduled daily task. Each user who has this feature enabled will be synced — users who do not individually enable it will not see changes.
When sync runs by either method, C-W detects which custom column from Calibre is configured as "collections" and then gathers all books that have collections set. For each named collection, if that collection does not exist as a shelf on the user's account, the shelf is created. Shelves are never removed. Then the set of bookids in the Calibre collection is diffed against the set of bookids in the C-W shelf. Missing books are added, and surplus books are removed. To maintain a shelf in C-W separately from Calibre, just name it something that doesn't exist in Calibre.