Firstly, the driver does not create duplicate collections. It checks for the existence of a collection of the name needed before creating. The duplicates come from the Kobo server during a sync. Which is what you see after deleting the collections. The duplicates are actually collections with the same name that were synced and then deleted.
How are you deleting the collections? Deleting a duplicate doesn't work from the device interface. Or at least it didn't the last time I tried. And unless the collection is empty, the calibre driver won't delete it. If you have books on the SD card that are in a collection and remove the card, the driver doesn't consider the collection to be empty. The database on the device still has details of the books, so they will be listed again when the card is reinserted.
You can use my Kobo Utilities plugin to clear up the duplicates. It has a function to do this. It displays the list of collections with the count of duplicates. The options are whether to keep the oldest or newest, and whether to purge the deleted collections. If you don't select the purge, the collections are deleted in a way that at the next sync, the Kobo server should see them and mark them as deleted.
|