Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-28-2023, 10:07 AM   #1141
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
New Test Version

I uploaded a new test version to the second post, it fixes a problem reported here. I was not really able to solve the reported problem, so I had to work around it by replacing it with a button and a dialog combo. This problem was introduced by changes in calibre version 5.33.2. Given that no one reported it till now, it seems that this particular widget is rarely used, so the workaround is not going to be a big problem.

The new version also changes the way the predefined single field edit widgets are implemented for all fields. The change is done improve the readability and maintenance of code. So I like to get confirmation that all is working well before releasing it. Since it now stacks all the predefined widgets instead of loading it at demand, it might lead to a slight lag.
Attached Thumbnails
Click image for larger version

Name:	comments.jpg
Views:	701
Size:	39.7 KB
ID:	202846  

Last edited by capink; 07-28-2023 at 10:43 AM.
capink is offline   Reply With Quote
Old 07-28-2023, 06:19 PM   #1142
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
It seems to work as expected when I try it.
ownedbycats is offline   Reply With Quote
Advert
Old 07-28-2023, 07:52 PM   #1143
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Small, odd bug I've noticed:

I have several chains with Kobo Utilities actions that are only available in this context:
a) A device is connected.
b) Calibre is in Library (not Device view).

I recently found that if I switch to Device view, back to Library, and then try to run the Action Chain immediately after, it fails validation. It works again if I do one of these:

1. Run an unrelated chain.
2. Open the chain editor and re-select the actions.

Any idea what may be the issue here? Perhaps there's some failure in it detecting the changes between Device/Library view.
ownedbycats is offline   Reply With Quote
Old 07-29-2023, 07:30 AM   #1144
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
I don't have a Kobo, so I am not able to test this, as the actions of the Kobo Utilities are greyed out unless you are connected to Kobo device. My only other suggestion is to wait a little longer before running the chain and see whether that makes a difference.
capink is offline   Reply With Quote
Old 08-18-2023, 06:36 AM   #1145
sios00
Enthusiast
sios00 began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2022
Device: Kobo Libra 2
Any tips on how to do this? https://www.reddit.com/r/Calibre/com...libraries_help

I currently have 2 virtual libraries with their own virtual library tabs on top of Calibre. I would like to use this in conjunction with the View Manager plugin, whereby when I select the virtual library tab, the view manager will automatically show the view for that virtual library, without using any keyboard shortcuts.

I am currently having issue with doing the portion of setting up what happens when I select the virtual library tab.
Currently, in order to get the View Manager view, I have to select the View Manager plugin icon, then select the specific view that I want.

Also, is there more documentation on what code classes available that we can use when adding custom chains?

Thank you!

Last edited by sios00; 08-18-2023 at 07:15 AM. Reason: Added what I am stuck with.
sios00 is offline   Reply With Quote
Advert
Old 08-19-2023, 07:28 AM   #1146
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
You need to do the following to have View Manager switch views automatically on tab change:
  • Add the "Switch to VL View" custom action using the module manager.
  • Create a chain that contains the custom action you just added. This actions allows you to assign View Manager views to virtual library tabs. Configure as you want.
  • In the event manager, add a "VL Tab Changed". Then attach the chain you created to this event.
capink is offline   Reply With Quote
Old 08-19-2023, 05:27 PM   #1147
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by capink View Post
You need to do the following to have View Manager switch views automatically on tab change:
  • Add the "Switch to VL View" custom action using the module manager.
  • Create a chain that contains the custom action you just added. This actions allows you to assign View Manager views to virtual library tabs. Configure as you want.
  • In the event manager, add a "VL Tab Changed". Then attach the chain you created to this event.
Also, putting the chain in the submenu 'Invisible' (case-sensitive?) will make it not appear in the menu.
ownedbycats is offline   Reply With Quote
Old 08-20-2023, 05:30 PM   #1148
sios00
Enthusiast
sios00 began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2022
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
You need to do the following to have View Manager switch views automatically on tab change:
  • Add the "Switch to VL View" custom action using the module manager.
  • Create a chain that contains the custom action you just added. This actions allows you to assign View Manager views to virtual library tabs. Configure as you want.
  • In the event manager, add a "VL Tab Changed". Then attach the chain you created to this event.
Thank you!! This worked great!


Quote:
Originally Posted by ownedbycats View Post
Also, putting the chain in the submenu 'Invisible' (case-sensitive?) will make it not appear in the menu.
Thanks for this! I tried it with the capital I and it worked.
sios00 is offline   Reply With Quote
Old 08-30-2023, 11:03 AM   #1149
hillcountryfare
Member
hillcountryfare began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jul 2023
Device: KPW, Fire Tablet 8
Cool

I am loving this plugin but have a few things I can't figure out.

1) When I run an action chain with update metadata and covers and have more than 7 books selected, I get 503 and 403 errors related to rate limiting. Is there any way to add a delay or retry?

2) Is there a way to control which of the selected books a called chain executes against? I only want to run the Find ISBN plugin against books with no ISBN after their metadata is updated. I have tried a condition (program:ifempty(field('#isbn'),'FALSE')) but it appears if the condition matches on any book the action chain will run on all the selected books.

3) I'd love to automate updating covers, but occasionally the downloaded covers are very low quality. Is there a way to only accept covers that are a higher resolution than the current covers? Alternatively, to only accept covers that are larger than a predefined dimension?
hillcountryfare is offline   Reply With Quote
Old 08-31-2023, 03:25 PM   #1150
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by hillcountryfare View Post
I am loving this plugin but have a few things I can't figure out.

1) When I run an action chain with update metadata and covers and have more than 7 books selected, I get 503 and 403 errors related to rate limiting. Is there any way to add a delay or retry?
This is an issue with whatever metadata plugin being used at the time. Action Chains cannot do anything about it.


Quote:
Originally Posted by hillcountryfare View Post
I am loving this plugin but have a few things I can't figure out.
2) Is there a way to control which of the selected books a called chain executes against? I only want to run the Find ISBN plugin against books with no ISBN after their metadata is updated. I have tried a condition (program:ifempty(field('#isbn'),'FALSE')) but it appears if the condition matches on any book the action chain will run on all the selected books.
Conditions control whether an action runs or not. If you want to act on a subsection of current selection, the solution is to use the "Search Using Template" action to modify the selection as follows:
  • Enter the following template:
    Code:
    program:
    	original_selection = from_selection('id');
    	set_globals(original_selection=original_selection);
    	new_selection = '';
    	for book_id in original_selection:
    		isbn = select(book_field(book_id, 'ids'), 'isbn');
    		if ! isbn then
    			new_selection = list_join(new_selection, book_id, ',')
    		fi
    	rof;
    	new_selection
  • Select the "Output is a book_ids list" radio button.
  • Tick the "Select all books resulting from this template" checkbox.

Note: The previous template stores the original selections in a global variable called original_selection. In case you want to restore those selections, you use the same action with this template:
Code:
program:
	globals(original_selection)
Quote:
Originally Posted by hillcountryfare View Post
I am loving this plugin but have a few things I can't figure out.
3) I'd love to automate updating covers, but occasionally the downloaded covers are very low quality. Is there a way to only accept covers that are a higher resolution than the current covers? Alternatively, to only accept covers that are larger than a predefined dimension?
Again nothing the Action Chains can do about this.
capink is offline   Reply With Quote
Old 09-02-2023, 01:26 AM   #1151
hillcountryfare
Member
hillcountryfare began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jul 2023
Device: KPW, Fire Tablet 8
Quote:
Originally Posted by capink View Post
This is an issue with whatever metadata plugin being used at the time. Action Chains cannot do anything about it.


Thank you so much! this got me going in the right direction. I had to modify your code, the new_selection was only storing one book at a time. I also kept getting errors about retrieving data from 'ids', so I changed it to use the custom column I have for ISBN.

Code:
program:
	original_selection = from_selection('id');
	set_globals(original_selection=original_selection);
	new_selection = '';
	for book_id in original_selection:
		isbn = select(book_field(book_id, 'ids'), 'isbn');
		if ! isbn then
			new_selection = list_join(new_selection, book_id, ',')
		fi
	rof;
	new_selection
Will keep trying to figure out a solution to creating a delay with the metadata.
hillcountryfare is offline   Reply With Quote
Old 09-09-2023, 03:28 PM   #1152
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Minor bug: If the user fails to click an item in the Calibre Actions setting dialog, there's a 'list index out of range' error, which isn't very informative.

Last edited by ownedbycats; 09-09-2023 at 03:30 PM.
ownedbycats is offline   Reply With Quote
Old 09-09-2023, 05:40 PM   #1153
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Version 1.18.13 - 10 September 2023
capink is offline   Reply With Quote
Old 09-13-2023, 11:20 PM   #1154
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Questions related to a possible bug I had:

1. Are there any differences between AC's convert and Calibre's convert?
2. How do I get a conversion log? It didn't appear in Jobs and re-running the conversion didn't make one appear in Temp. Alternately: How to copy the settings over so I can get a log?

Last edited by ownedbycats; 09-13-2023 at 11:32 PM.
ownedbycats is offline   Reply With Quote
Old 09-14-2023, 12:20 AM   #1155
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
1. Are there any differences between AC's convert and Calibre's convert?
It calls calibre convert code after feeding it the settings. Does not change anything.

Quote:
Originally Posted by ownedbycats View Post
2. How do I get a conversion log? It didn't appear in Jobs and re-running the conversion didn't make one appear in Temp. Alternately: How to copy the settings over so I can get a log?
It does not use calibre jobs. Calibre jobs are not documented anywhere. I did have a quick look at calibre code and a couple of plugins, which was not really much of help for me, so I decided it is not worth the effort.

There is no way to copy the settings. You have to manually choose the same settings in calibre convert. If you want to get a log while using AC convert, use calibre-debug and you will see calibre convert log printed there.
capink is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] Editor Chains capink Plugins 106 06-17-2025 05:36 PM
Action Chains Resources capink Plugins 77 06-16-2025 12:45 PM
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB lrpirlet Plugins 2 08-18-2022 03:15 PM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM


All times are GMT -4. The time now is 09:15 PM.


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