View Single Post
Old 03-12-2022, 09:30 AM   #2677
giddie
Member
giddie began at the beginning.
 
giddie's Avatar
 
Posts: 19
Karma: 10
Join Date: Jan 2017
Location: Birmingham, UK
Device: Kobo Aura H2O
Quote:
Originally Posted by davidfor View Post
An alternative is to use a custom column with a template for the collections. [...]

Code:
if (connected_device_uuid("main") == 'efb3184b-26e8-4017-8359-51b4168d4a92') then
 $#mm_collections
fi;
[...] as it returns a list of tags, it should work with no problems if I used that column as a collection column in the driver configuration.
This seemed like a very promising idea, and I finally made some time to experiment with it. Unfortunately it doesn't seem to be the silver bullet: although the column does populate when the correct device is connected, I found that collections were only partially synced to the device. Possibly a race condition between the syncing and column definition when device is plugged?

But a more serious issue is that when the device id does not match, all collections are wiped out, because the driver tries to sync collections for all the books, and finds that the sync column is blank. So that's basically as bad as overwriting the collections for this device, which brings us back to square 1.

But it has made me wonder - could it be possible to make the "Collections columns" field in the driver configuration a template? That way we could use the same trick to return a different column name depending on the connected device? In that case, a non-matching device uuid should result in no column being specified for collections sync, so the driver will not try to do any syncing.
giddie is offline   Reply With Quote