View Single Post
Old 09-30-2023, 03:48 PM   #4
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by kjdavies View Post
Is there a way to have calibredb use the 'merge' action I use via the GUI? This not the same as adding a format.

I am cleaning up a few libraries I have integrated. I have a reliable identifier I can use to identify duplicates (CRC,extension,filesize) but other associated information such tags and tag-like fields.. These are bitwise-identical files, but I want to aggregate the supplementary information.

What I'd like to do is write a script that will examine all sets of titles with the same unique key, and where the titles and authors match, merge them into a single entry. (I'll want to examine where these things differ to see which ones I prefer, so I'll still need to handle these ones manually.)

I could make my script a little more sophisticated, of course, and handle the aggregation myself via set_metadata... but if it's already built-in, I'd rather do that. It's less work for me, and much more importantly, less prone to error.
A combination of Find Duplicates and Action Chains plugin can help you achieve what you want:
  1. Use the Find Duplicates plugin to group the identical books.
  2. Using Action Chains plugin, you can use this custom module to auto-merge the book records of the same duplicate group. The will be merged into the first book of each group.

Notes:
  • To add the custom module, go to Action Chains > Manage Module > add
  • This is a destructive action after which you will not be able to restore your merged records, make sure you backup you library before you proceed. You are ultimately responsible for any damage that might happen.
capink is offline   Reply With Quote