| 
			
			 | 
		#1486 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,698 
				Karma: 79983758 
				Join Date: Nov 2007 
				Location: Toronto 
				
				
				Device: Libra H2O, Libra Colour 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Sent from my Pixel 7a using Tapatalk  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1487 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686 
				Karma: 12595249 
				Join Date: Jun 2009 
				Location: Madrid, Spain 
				
				
				Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
   ), but it doesn't happen to me ("Mostrar" sticks if I select it).
		 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1488 | |
| 
			
			
			
			 want to learn what I want 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,681 
				Karma: 7908443 
				Join Date: Sep 2020 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 I have tested switching UI language to Italian and English and the validation error doesn't happen  
		 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1489 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686 
				Karma: 12595249 
				Join Date: Jun 2009 
				Location: Madrid, Spain 
				
				
				Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1490 | 
| 
			
			
			
			 Custom User Title 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,359 
				Karma: 79528341 
				Join Date: Oct 2018 
				Location: Canada 
				
				
				Device: Kobo Libra H2O, formerly Aura HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I occasionally have trouble with validation on some items that change the menu name, e.g. Sync List and Sync List (1). If it's detecting by name perhaps?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1491 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 922 
				Karma: 810834 
				Join Date: Sep 2017 
				Location: Buenos Aires, Argentina 
				
				
				Device: moon+ reader, kindle paperwhite 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Apparently there were changes in the plugin code. I'm offering to update the translation. I'm actually working on it, but I wanted to give you some peace of mind. 
		
	
		
		
			I leave in this zip the po and mo files with the translation into Spanish Last edited by dunhill; 04-12-2025 at 07:23 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1492 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686 
				Karma: 12595249 
				Join Date: Jun 2009 
				Location: Madrid, Spain 
				
				
				Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thank you very much for the files, I'll include them in my plugin. I guess capink will include them in a newer release.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1493 | 
| 
			
			
			
			 Custom User Title 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,359 
				Karma: 79528341 
				Join Date: Oct 2018 
				Location: Canada 
				
				
				Device: Kobo Libra H2O, formerly Aura HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Is it possible to put a separator between two variants in a chains? Dont think so but want to check.
		 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Last edited by ownedbycats; 04-15-2025 at 11:49 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1494 | 
| 
			
			
			
			 Member 
			
			![]() Posts: 23 
				Karma: 10 
				Join Date: Jun 2016 
				Location: France 
				
				
				Device: PocketBook Touch Lux 2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Hi 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Is there a way to duplicate a book with an Action chain module? My level of Python knowledge is clearly insufficient, and all my attempts have failed..  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1495 | |
| 
			
			
			
			 Junior Member 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3 
				Karma: 15972 
				Join Date: Mar 2025 
				
				
				
				Device: kindle oasis 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Duplicate Book module
			 
			Quote: 
	
 Code: 
	import os
from calibre_plugins.action_chains.actions.base import ChainAction
class DuplicateBookAction(ChainAction):
    name = 'Duplicate Book'
    support_scopes = True
    # code adapted from calibre/gui2/actions/add.py:add_empty()
    def run(self, gui, settings, chain):
        db = gui.current_db
        selected_books = chain.scope().get_book_ids()
        
        ids, orig_fmts = [], []
        for book_id in selected_books:
            metadata = db.get_metadata(book_id, index_is_id=True, get_cover=True, cover_as_data=True)
            orig_fmts = tuple(db.new_api.format(book_id, fmt, as_path=True) for fmt in db.new_api.formats(book_id))
            new_book_id = db.import_book(metadata, orig_fmts)
            ids.append(new_book_id)
            
        self.refresh_gui(gui, len(selected_books))
        # entirely optional: select and mark the copies
        if ids:
            ids.reverse()
            gui.library_view.select_rows(ids)
            db.set_marked_ids({id: 'duplicate' for id in ids})
        # clean up temp files created by new_api.format()
        for path in orig_fmts:
            os.remove(path)                        
    def refresh_gui(self, gui, num):
        gui.library_view.model().books_added(num)
        gui.refresh_cover_browser()
        gui.tags_view.recount()
 | 
|
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1496 | 
| 
			
			
			
			 Member 
			
			![]() Posts: 23 
				Karma: 10 
				Join Date: Jun 2016 
				Location: France 
				
				
				Device: PocketBook Touch Lux 2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thanks a lot, works perfectly!  
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1497 | 
| 
			
			
			
			 Custom User Title 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,359 
				Karma: 79528341 
				Join Date: Oct 2018 
				Location: Canada 
				
				
				Device: Kobo Libra H2O, formerly Aura HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Chain Variant: Suppose I have chain withb 4 variants. I want to have 2 run a specific action, 2 to not. What do I set  _variant_argument?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1498 | ||
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,216 
				Karma: 1995558 
				Join Date: Aug 2015 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
 The condition on that particualr action should be: Code: 
	template = program: globals(_variant_argument) datatype = number comparison = ">" condition value = 2 Last edited by capink; 05-22-2025 at 05:58 AM.  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1499 | 
| 
			
			
			
			 Custom User Title 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,359 
				Karma: 79528341 
				Join Date: Oct 2018 
				Location: Canada 
				
				
				Device: Kobo Libra H2O, formerly Aura HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Additionally, instead of two separate SFEs with _variant_argument as a conditional, can _variant_argument be used in a SFE (templated)? 
		
	
		
		
		
		
		
		
		
		
		
		
		
			EDIT: It does. I set to null for one variant, and current date for another. Last edited by ownedbycats; 05-26-2025 at 06:36 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#1500 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,216 
				Karma: 1995558 
				Join Date: Aug 2015 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Code: 
	Do something and rate: ★ Do something and rate: ★★ Do something and rate: ★★★ Do something and rate: ★★★★ Do something and rate: ★★★★★ The template for the chain variations is like this: Code: 
	program:
    text = 'Do something and rate: ';
    for rating in range(2,11,2):
        text = text & '★';
        add_chain_variant(text, rating, 'submenu name')
    rof
Now, you can use single field edit to set the rating based on the _variant_argument: Code: 
	program:
    globals(_variant_argument)
Last edited by capink; 05-26-2025 at 07:40 PM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Action Chains Resources | capink | Plugins | 80 | 09-18-2025 05:45 AM | 
| [Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 06:36 PM | 
| [GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 04:15 PM | 
| [GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 06:25 AM |