Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-06-2020, 04:27 PM   #1
un_pogaz
Chalut o/
un_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watch
 
un_pogaz's Avatar
 
Posts: 171
Karma: 10500
Join Date: Dec 2017
Device: Kobo
[GUI Plugin] Mass Search/Replace

Mass Search/Replace is a small plugin to facilitate the execution of one or more of your favorite Search and Replace operations to your books metadata.

Each entry in the context menu will launch a list of Search/Replace operations that you have previously set up. Setting up an operation uses the Calibre Search and Replace module.

The plugin has the following features:
  • Editable context menu
  • Editables operations list
  • Quick Search/Replace
  • Error Strategy

Installation
Open Preferences -> Plugins -> Get new plugins and install the "Mass Search/Replace" plugin.
You may also download the attached zip file and install the plugin manually, then restart calibre as described in the Introduction to plugins thread

Special Notes:
  • Uses the Calibre Search/Replace module.
  • You can destroy your library using this plugin. Changes are permanent. There is no undo function. You are strongly encouraged to back up your library before proceeding.

Credits:
  • The icon dialog and the dynamic menus for chains are based on code from the Open With plugin by kiwidude.
  • The Calibre Actions is based on code from the Favourites Menu plugin by kiwidude.
  • The module editor is based on calibre editor function editor by Kovid Goyal.
  • The Search and Replace Action is based on calibre's search and replace. (chaley and Kovid Goyal)
  • Thanks to capink and its plugin Action Chains without which this one wouldn't exist.

Version History:
Spoiler:
version 0.9.2
Add Spanish translation
Thanks *dunhill*

version 0.9.2
FIX case for the test result field
FIX detection of None and inchanged value

version 0.9.1
fix library switch

version 0.9.0
First release
Beta public test

GitHub

Note for those who wish to provide a translation:
I am French! Although for obvious reasons, the default language of the plugin is English, keep in mind that already a translation.
Attached Thumbnails
Click image for larger version

Name:	context.png
Views:	108
Size:	64.4 KB
ID:	183820   Click image for larger version

Name:	config-menu.png
Views:	103
Size:	51.3 KB
ID:	183821   Click image for larger version

Name:	config-operation.png
Views:	93
Size:	29.6 KB
ID:	183822  
Attached Files
File Type: zip Mass Search-Replace 0.9.3.zip (100.1 KB, 1912 views)

Last edited by un_pogaz; 12-08-2020 at 04:45 PM.
un_pogaz is offline   Reply With Quote
Old 12-06-2020, 04:28 PM   #2
un_pogaz
Chalut o/
un_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watch
 
un_pogaz's Avatar
 
Posts: 171
Karma: 10500
Join Date: Dec 2017
Device: Kobo
DEV NOTE:
The Caliber 4 combatibilty has only been tested superficially, returns are welcome.
un_pogaz is offline   Reply With Quote
Advert
Old 12-07-2020, 11:03 AM   #3
jjk
Enthusiast
jjk began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Hello un_pogaz
Thanks for your plugin. I've just tried it a little. (on Calibre 5.6)
In fields=authors, I search "Cam" and replace it by "CAM", case-sensitive, type=car. match (not regex).
Casse to apply to each replace = All in CAPS

I select some books from Camilla Lackberg, and other ones. For each of those selected books, authors are Camilla Lackberg, or Jack London..., ie initials in CAPS (MAJUSCULES), other letters not in CAPS (so minuscules)

When I apply MSR plugin, all authors become all in CAPS (CAMILLA LACKBERG, JACK LONDON...), although I thought that they would become CAMilla Lackberg, Jack London ... because I had precised only Cam/CAM in S/R fields.

In a second time, to try to repare it, I put : Casse to apply to replace = Majuscule à chaque mot (I'm French also), and still S/R=Cam/CAM.
Result : CamILLA LACKBERG, Jack London
I don't understand the whole logic.

That is all my test for the moment.

Anyway, your plugin is promising. Cheers.
jjk is offline   Reply With Quote
Old 12-07-2020, 12:26 PM   #4
un_pogaz
Chalut o/
un_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watch
 
un_pogaz's Avatar
 
Posts: 171
Karma: 10500
Join Date: Dec 2017
Device: Kobo
Si t'est français, met ton texte en français dans un Spoiler, et traduit traduit normalement pour le mesage publique.

Spoiler:
Je rappel que j'ai utilisé le module de Calibre telle quelle, et je peut difficilement le "corrigé". Aussi, il est difficile a mettre en tort, encore faut-il comprendre ça logique.

Pour le premier cas:
Apparemment dans type=car. match (not regex), Calibre applique la "CASE applique sur le remplacement" dans tous les cas. Il ne faut vraiment l'utilisé qu'avec parcimonie.
Dans votre cas, il aurait fallut gardé "Casse a appliqué" vide.
Le case-sensitive ne marche que pour la recherche : Cam/cam/cAm => CAM

Pour second cas:
Ça ressemble plus un bug de Calibre. Signale-le en temps que telle, je vais voir de mon coté ce que je peut faire.
En gros, la Casse n'est appliqué normalement que pour le texte de remplacement, le reste est copier telle quelle.
Mais dans le cas où le texte cherchée n'est pas trouvé, il capture tous et applique la Casse.
(CAM)ILLA LACKBERG, (JACK LONDON) => (Cam)ILLA LACKBERG, (Jack London)
Seul le texte entre parenthèse voit ça Casse changé.

A la réflexion, le modificateur de Casse n'e doit être utilisé que pour du Regex.


EDIT: Après avoir regardé, s'est bien le comportement attendu.
Le seul bug est que, en mode "Correspondance de caractères", la Casse n'est pas correctement appliqué dans le champs de test. J'ai corrigé et reporté le bug.


I remind you that I used the Caliber module as is, and I can hardly "correct" it. Also, it is difficult to blame it, but it is still necessary to understand that logic.

For the first case:
Apparently in type=car. match (not regex), Calibre applies the "CASE applies on replacement" in all cases. It should really be used sparingly.
In your case, you should have kept "Case applied" empty.
The case-sensitive only works for search : Cam/cam/cAm => CAM

For second case:
It looks more like a Caliber bug. Report it as such, I'll see what I can do.
Basically, the Case is normally applied only for the replacement text, the rest is copied as is.
But if the text you are looking for is not found, it captures all of it and applies the Casse.
(CAM)ILLA LACKBERG, (JACK LONDON) => (Cam)ILLA LACKBERG, (Jack London)
Only the text in brackets sees that Case changed.

On second thought, the Casse modifier should only be used for Regex.

EDIT: After look, this is expected behaviour.
The only bug is, in "Character Matching" mode, the box is not correctly applied in the test field. I have corrected and reported the bug.

Last edited by un_pogaz; 12-07-2020 at 02:09 PM.
un_pogaz is offline   Reply With Quote
Old 12-07-2020, 03:04 PM   #5
jjk
Enthusiast
jjk began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Ok. Sorry, I hadn't seen that it was an internal Calibre feature. And thanks for postponing the bug.
Spoiler:
Désolé, je n'avais pas vu que c'était une fonctionnalité interne à Calibre. Et merci d'avoir reporté le bug.
jjk is offline   Reply With Quote
Advert
Old 12-08-2020, 01:20 PM   #6
dunhill
Addict
dunhill has a complete set of Star Wars action figures.dunhill has a complete set of Star Wars action figures.dunhill has a complete set of Star Wars action figures.dunhill has a complete set of Star Wars action figures.
 
dunhill's Avatar
 
Posts: 276
Karma: 334
Join Date: Sep 2017
Device: moon+ reader, kindle paperwhite
Couldn't upload po and mo on GitHub
With your permission I upload them here.
Excelent travail!!
Attached Files
File Type: zip translations spanish.zip (9.8 KB, 26 views)
dunhill is offline   Reply With Quote
Old 12-08-2020, 04:29 PM   #7
un_pogaz
Chalut o/
un_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watchun_pogaz is clearly one to watch
 
un_pogaz's Avatar
 
Posts: 171
Karma: 10500
Join Date: Dec 2017
Device: Kobo
Thanks o/
un_pogaz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Search the Internet kiwidude Plugins 345 Yesterday 10:09 PM
[GUI Plugin] Drop Search Results DaltonST Plugins 22 12-21-2020 10:12 AM
[GUI Plugin] Clipboard Search kiwidude Plugins 18 12-09-2020 03:43 PM
Mass search and replace word in epub Fangles Library Management 4 07-26-2016 06:23 PM


All times are GMT -4. The time now is 05:21 AM.


MobileRead.com is a privately owned, operated and funded community.