View Single Post
Old 12-08-2020, 10:24 AM   #1
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Calibre Links, library_id, UUID, and Duplicates

While adding the new Calibre Links functionality to CalibreSpy, I necessarily looked at this new Calibre 5.6 function:
Code:
def create_copy_links(menu, data=None):
     library_id = getattr(db, 'server_library_id', None)
Calibre table library_id normally has a single record with a Calibre-setup generated (theoretically unique) UUID, such as "aedee8f6-9de0-4f01-ae45-f9e82c02450e".


The issue is that up to Calibre 5.6, it did not matter whatsoever to Calibre itself whether the UUID was actually unique. Now it appears to assume so.


Therein lies the rub.


Many users have several or many libraries with the identical UUID. Why?


[1] They took a 50,000 book library, physically copied it into a new directory (library) name, then deleted all of the Fiction, leaving only NonFiction. The original library was similarly pruned, leaving only Fiction. A simple Calibre > Library > Library Maintenance > Check Library easily deleted orphan books and authors, and then compressed both "new" libraries...having the identical UUID.


[2] Some plugins use special "template" libraries that the user of said plugins are required to use by checking the UUID. Hence, all of their customized versions of the mother template libraries have the identical UUID of their respective original templates.


Backwards compatibility is a real issue.


Changing each library's UUID is not an option.


Perhaps a new server_library_id UUID needs to be created, and Calibre have a menu action to automatically detect and repair duplicates (e.g. by using the historical list of known libraries retained by Calibre).






DaltonST

Last edited by DaltonST; 12-08-2020 at 10:28 AM.
DaltonST is offline   Reply With Quote