View Single Post
Old 10-08-2020, 10:07 AM   #768
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,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
Version 1.7.6

Version 1.7.6
Update: Advanced Mode: Add support for saving and restoring match rules.
Update: Advanced Mode: Add option to control sorting of books in duplicate groups. Requested by @tanjamuse
Update: Advanced Mode: Use calibre's template dialog for adding and editing templates.
Update: Advanced Mode: Mark first and last books in each duplicate group: "first_duplicate", "last_duplicate"
Update: Mark records with deleted formats in binary search as "deleted_binary_duplicate"
Update: Option to export duplicate groups to json file. For advanced mode, the sorting of books is retained in the json file.
Fix: Mark exemptions only when showing them and remove the marks afterwards.
Fix: Restore state if the user exits calibre with the duplicates restriction still on. Thanks to @chaley
Fix: Remember last sort in library view and restore it back.


With this new version, instead of repeating steps every time you invoke the advanced mode, you can save the match rules and restore in one click. You can also export these match rules for backup or for importing in other calibre libraries.

The new sort feature (a suggestion by @tanjamuse) allows you to control the sorting of books in duplicate groups. It is also complemented with marking the first book in the group as "first_duplicate" and the last book in the group as "last_duplicate". So if for example, if you want to show all the books in the group(s) except the last book(s) you can type the following in the search bar:

Code:
not marked:last_duplicate

N.B whether the above search applies to all groups or to the current group depends on the current search mode (either highlight or restrict results). To make it easier to switch between these two modes, follow the steps in this post.




Quote:
WARNING: Sometimes you might have one book belonging to two different duplicate groups. Because of the way this plugin marks duplicates, one of these two groups which have the same book might have its sort (and consequently, first_duplicate and last_duplicate marks) messed up. So, it is better to first deal manually with these groups. These groups can be shown by the following search:

Code:
marked:entangled_group
And if you want to show the books that belong to more than one group you can use this search:

Code:
marked:entangled_book
Another thing you can do with the sort is to use templates instead of columns. Say for example you want to sort the duplicate groups by the number of formats each record has, you can use this template in the sort dialog to achieve this:

Code:
{formats:count(,)}

If the above is not enough and you want more control of how to handle duplicate books, there is an option to export duplicate ids to json file, that can be later fed to calibre-debug (or a shell) script to handle them according to the needs of individual users. For the advanced mode, the exported json file retains the sort order specified by the user in the sort dialog.


Finally, for people who use the binary compare with automatic removal of duplicates, they can find the records with automatically deleted formats by typing this search:

Code:
marked:deleted_binary_duplicate
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	235
Size:	131.8 KB
ID:	182565   Click image for larger version

Name:	2.png
Views:	239
Size:	115.1 KB
ID:	182566   Click image for larger version

Name:	3.png
Views:	244
Size:	123.0 KB
ID:	182567   Click image for larger version

Name:	4.png
Views:	235
Size:	67.1 KB
ID:	182568   Click image for larger version

Name:	5.png
Views:	230
Size:	100.7 KB
ID:	182569  

Last edited by capink; 10-09-2020 at 04:24 AM. Reason: remove attached plugin. A newer version attache to a later post
capink is offline   Reply With Quote