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 10-13-2024, 02:15 AM   #1396
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
I'd like to make a chain that does arithmetic on a floating-point column and then adds the results from all selected books together. How would I go about this?

Code:
program: format_number($$#purchasecost - format_number($$#purchasecost/1.15, '.2f'), '.2f')
For context, was just curious how much of the value of my library is in sales tax.
You can use this sample chain as an example.

The attached chain is another example that uses a different technique.
Attached Files
File Type: zip sum_ratings_chain.zip (544 Bytes, 197 views)
chaley is offline   Reply With Quote
Old 10-22-2024, 01:18 AM   #1397
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
is there a way to add the entire series of the selected book? I'm using 'Reading Goal' and it doesn't have that option
correoparaappzz is online now   Reply With Quote
Advert
Old 10-22-2024, 05:28 PM   #1398
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 correoparaappzz View Post
is there a way to add the entire series of the selected book? I'm using 'Reading Goal' and it doesn't have that option
If the 'Reading Goal' has a menu option to add the series, you can choose that from Calibre Actions.

If the 'Reading Goal' has no such option, you will have to make the Action Chains select all the books in the series. You can do this by adding the following template to "Search Using Templates" action:

Code:
program:
	initial_ids = from_selection('id');
	set_globals(initial_ids=initial_ids);
	all_series_ids = '';
	for book_id in initial_ids:
		series = book_field(book_id, 'series');
		series_ids = from_search('id', 'series:"=' & series & '"');
		all_series_ids = list_union(all_series_ids, series_ids, ',')
	rof;
	all_series_ids
Note: In the "Search Using Templates" action, make sure to tick the option: "Template output is a list of book ids"

If you want to revert to the original selections after adding all the books in the series, you can use another "Search Using Templates" action with the following template:

Code:
program:
    globals(initial_ids)
Note: In the "Search Using Templates" action, make sure to tick the option: "Template output is a list of book ids"
capink is offline   Reply With Quote
Old 10-22-2024, 08:01 PM   #1399
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
Quote:
Originally Posted by capink View Post
If the 'Reading Goal' has a menu option to add the series, you can choose that from Calibre Actions.

If the 'Reading Goal' has no such option, you will have to make the Action Chains select all the books in the series. You can do this by adding the following template to "Search Using Templates" action:

Code:
program:
	initial_ids = from_selection('id');
	set_globals(initial_ids=initial_ids);
	all_series_ids = '';
	for book_id in initial_ids:
		series = book_field(book_id, 'series');
		series_ids = from_search('id', 'series:"=' & series & '"');
		all_series_ids = list_union(all_series_ids, series_ids, ',')
	rof;
	all_series_ids
Note: In the "Search Using Templates" action, make sure to tick the option: "Template output is a list of book ids"

If you want to revert to the original selections after adding all the books in the series, you can use another "Search Using Templates" action with the following template:

Code:
program:
    globals(initial_ids)
Note: In the "Search Using Templates" action, make sure to tick the option: "Template output is a list of book ids"
correoparaappzz is online now   Reply With Quote
Old 10-23-2024, 12:03 AM   #1400
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Why not using the Calibre built-in function similar series?
Wiggo is offline   Reply With Quote
Advert
Old 10-23-2024, 03:38 AM   #1401
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 Wiggo View Post
Why not using the Calibre built-in function similar series?
That works only for one book. If you have multiple books selected and you use the calibre builtin function, it will only show the books in the series for the active selected book.
capink is offline   Reply With Quote
Old 11-02-2024, 09:33 PM   #1402
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,614
Karma: 7891011
Join Date: Sep 2020
Device: none
Not a big issue but I found that some icons in the Chains dialogue can't be themed:
  • arrow-up
  • arrow-down
  • edit-copy
  • minus
  • plus
I was able to override them using the resources/images folder. However, from looking at 'def get_icon_6_2_plus' in common_utils.py, it looks to me that the icon theme should be prioritized, though it isn't currently being acknowledged, for some reason.

I wanted mainly to theme the 'plus' and 'edit-copy' icons because they look to me a bit faint in dark mode.

The other icons, notably the ones called by Qpushbutton, will change in accordance to the theme images.

I'm running 7.20.101 with the latest plugin version 1.20.7.

Click image for larger version

Name:	2024-11-02 20_34_38-Chains Dialog.jpg
Views:	222
Size:	45.2 KB
ID:	211813
Click image for larger version

Name:	2024-11-02 20_34_18-Manage modules.png
Views:	207
Size:	10.1 KB
ID:	211814
Comfy.n is offline   Reply With Quote
Old 11-03-2024, 01:02 PM   #1403
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 Comfy.n View Post
Not a big issue but I found that some icons in the Chains dialogue can't be themed:
Try the version attached below and see whether it works. This happened after calibre was updated to version 6 with some changes to icon management. I did not fully port the whole code at the time. The changes affect the following parts of the plugin:
  • Chains dialog.
  • Actions dialog.
  • Events dialogs.
  • Calibre Actions.
  • Chain Variables
  • Single Field Edit.

So please, if you have the time, test these areas to make sure everything is working properly before releasing any new version. I am not much interested in theming, and I guess it will be the same for most users.

Quote:
Originally Posted by Comfy.n View Post
it looks to me that the icon theme should be prioritized, though it isn't currently being acknowledged, for some reason.
That is a matter of opinion. I personally think the priority should be to custom icons.

Last edited by capink; 12-28-2024 at 03:38 PM. Reason: remove attached zip
capink is offline   Reply With Quote
Old 11-03-2024, 03:41 PM   #1404
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,614
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by capink View Post
Try the version attached below and see whether it works. This happened after calibre was updated to version 6 with some changes to icon management. I did not fully port the whole code at the time. The changes affect the following parts of the plugin:
  • Chains dialog.
  • Actions dialog.
  • Events dialogs.
  • Calibre Actions.
  • Chain Variables
  • Single Field Edit.

So please, if you have the time, test these areas to make sure everything is working properly before releasing any new version. I am not much interested in theming, and I guess it will be the same for most users.
Wheee, it works! I did a few tests in each area and all seems fine:

Click image for larger version

Name:	2024-11-03 17_14_15-Chains Dialog.png
Views:	197
Size:	36.7 KB
ID:	211835

Click image for larger version

Name:	events MWSnap 2024-11-03, 17_21_18.png
Views:	200
Size:	20.8 KB
ID:	211834

Quote:
That is a matter of opinion. I personally think the priority should be to custom icons.
Actually what I wanted to mean was that, according to the comments in the code, the icon theme images were expected to be used in preference to the resources folder.

I too think that the resources folder must have higher priority than the themes. And upon a quick test using distinct icons for the main plugin icon in the theme and in resources folder, all is working fine as well: the image that shows in Calibre main toolbar is the one in resources.

edit to add - now that I looked again at the comments in the code, it's clear that I got things mixed up:

Click image for larger version

Name:	MWSnap 2024-11-03, 17_45_47.png
Views:	196
Size:	8.0 KB
ID:	211836


Last edited by Comfy.n; 11-03-2024 at 04:52 PM.
Comfy.n is offline   Reply With Quote
Old 11-03-2024, 07:52 PM   #1405
Hotrod_Linc
Junior Member
Hotrod_Linc began at the beginning.
 
Hotrod_Linc's Avatar
 
Posts: 6
Karma: 10
Join Date: Nov 2024
Device: Kindle
Post Using Action Chains to trigger Generate Cover Plugin for News Feed

Hello!

I am trying to find a way to apply a cover that is automatically updated with the days date to a epub created by the News Feed function. In my quest I have come across many posts looking to do something similar, however nothing I have found works. I came across the Generate Cover plugin, which can create the cover in the way I like, however I would like to automate the application of that cover.

I would like to know if its possible to use Action Chains to do the following:

1. Calibre pulls requested news sources and produces epub.
2. Action Chains identifies the new epub and triggers Generate Covers Plugin
3. Generate Covers Plugin applies the predetermined cover preset
4. Epub is now covered with custom cover and date on the cover.

My apologies I am largely useless with python, any help would be appreciated.

-Linc
Hotrod_Linc is offline   Reply With Quote
Old 11-05-2024, 03:57 AM   #1406
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
I don't really have much experience with fetch news or Generate Cover plugin. Maybe others who use these things can comment on whether this can be done or not. You can try yourself to see whether this can be automated using an "Calibre Actions" in the Actions Chains plugin.
capink is offline   Reply With Quote
Old 11-07-2024, 05:29 PM   #1407
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: 11,019
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I want to create a chain with three variants:

Code:
program:
    add_chain_variant('Update Reading Goal Genres','genres','', 'statistics.png');
    add_chain_variant('Update Reading Goal Challenges','challenges','','statistics.png');
    add_chain_variant('Update Genres + Challenges','','','statistics.png');
Would the best way to do the conditionals would be to, for example, set 'update challenges' action conditional to exclude genres (text >= genres)?

Last edited by ownedbycats; 11-07-2024 at 05:33 PM.
ownedbycats is online now   Reply With Quote
Old 11-12-2024, 09:32 AM   #1408
Bozana
Bozana
Bozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beauty
 
Bozana's Avatar
 
Posts: 25
Karma: 32224
Join Date: Jan 2013
Device: PC
Can I say that I'm confused as anything on how to use and implement Action Chains. I have loads of search and replace actions that I would like to happen in order. And by pressing one button to do this. Is there a simplified version on how to do this or a video?

I'm level 2 autistic. And I'm usually ok with this sort of thing but when it's ambiguous to me, I get lost. And I'm in my 50's. However, once I understand it, I tend to "dumb it down" or simplify it for others that are struggling with more clarified steps.

Kindest regards

Božana
Bozana is offline   Reply With Quote
Old 11-12-2024, 10:01 AM   #1409
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,614
Karma: 7891011
Join Date: Sep 2020
Device: none
this a quick draft:

- Action Chains plugin menu -> Add/Modify chains (this brings up the main Chains dialog)

- click the plus icon to add a menu item row (each row is a "chain", but it may contain just one action).

- double-click the title cell, enter your chain title. submenu isn't mandatory, but once you create a lot of chains, you will need it)

- click the gear icon in that same row to add some actions

- in this new dialog that just opened, click the plus icon

- double-click action cell, then select Search and replace. Then click the gear icon in that same row, to open your s & r presets and select it.

- keep clicking ok to dismiss all dialogs, voilà!
Comfy.n is offline   Reply With Quote
Old 11-13-2024, 09:52 PM   #1410
Bozana
Bozana
Bozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beautyBozana does all things with Zen-like beauty
 
Bozana's Avatar
 
Posts: 25
Karma: 32224
Join Date: Jan 2013
Device: PC
Smile

Quote:
Originally Posted by Comfy.n View Post
this a quick draft:

- Action Chains plugin menu -> Add/Modify chains (this brings up the main Chains dialog)

- click the plus icon to add a menu item row (each row is a "chain", but it may contain just one action).

- double-click the title cell, enter your chain title. submenu isn't mandatory, but once you create a lot of chains, you will need it)

- click the gear icon in that same row to add some actions

- in this new dialog that just opened, click the plus icon

- double-click action cell, then select Search and replace. Then click the gear icon in that same row, to open your s & r presets and select it.

- keep clicking ok to dismiss all dialogs, voilà!
Thank you so very much Comfy! xoxoxo I did it! I will do a video on it for just search and replace with Action Chains! I'm so happy!
Bozana 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 06:57 PM.


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