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,018
Karma: 7257323
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, 18 views)
chaley is offline   Reply With Quote
Old 10-22-2024, 01:18 AM   #1397
correoparaappzz
Enthusiast
correoparaappzz began at the beginning.
 
Posts: 34
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
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,137
Karma: 1954142
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
Enthusiast
correoparaappzz began at the beginning.
 
Posts: 34
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: 487
Karma: 1153449
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
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,137
Karma: 1954142
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
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] Editor Chains capink Plugins 94 07-03-2024 07:26 PM
Action Chains Resources capink Plugins 65 07-01-2024 03:12 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 03:27 PM.


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