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 12-12-2021, 08:42 PM   #751
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Is Action Chain's Single-Field Edit able to use custom stored templates? I re-use certain templates a lot - but it's very easy to miss one when updating them.
ownedbycats is offline   Reply With Quote
Old 12-13-2021, 05:23 AM   #752
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,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Stored templates are part of the template language, so it should work.
capink is offline   Reply With Quote
Advert
Old 12-13-2021, 05:29 AM   #753
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Hmm, I'm getting an error for it. Did I format it wrong? It works in template tester.

Code:
calibre, version 5.33.2
ERROR: Template Error: Running the template: program: columnupdate_kobocoll() returned an error:
 Formatter: Unknown function columnupdate_kobocoll near 'columnupdate_kobocoll' on line 1
ownedbycats is offline   Reply With Quote
Old 12-13-2021, 06:40 AM   #754
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,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
That's odd. My own stored templates are working with no problems. Can you post your stored template to see if I can replicate?
capink is offline   Reply With Quote
Old 12-13-2021, 06:45 AM   #755
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Named it columnupdate_kobocoll.

All three of the listed columns are taglikes; #genres and #vls are composites (former puiling from tags, latter using the virtual_libraries() function).

Code:
program:
	g = field('#genres');
	k = field('#kobocoll');
	vl = field('#vls');

	v = first_non_empty(
		list_contains(vl, ',', '^Loans$', 'Loans', ''),
		list_contains(g, ',', '^Fanfiction$', 'Fanfiction', ''),
		list_contains(g, ',', '^Horses$', 'Horses', ''),
		list_contains(g, ',', '^Cozy Mystery$', 'Cozy Mysteries', ''),
		list_contains(g, ',', '^(Fantasy|Science Fiction)$', 'Fantasy & Sci-Fi', ''),
	);

	list_union(k, v, ',')
If it matters, I'm trying to update #kobocoll itself without erasing existing values.
Attached Thumbnails
Click image for larger version

Name:	2021-12-13 07_42_50-Template tester.png
Views:	306
Size:	23.1 KB
ID:	190804   Click image for larger version

Name:	2021-12-13 07_43_47-Edit Template.png
Views:	299
Size:	24.6 KB
ID:	190805  

Last edited by ownedbycats; 12-13-2021 at 06:49 AM.
ownedbycats is offline   Reply With Quote
Advert
Old 12-13-2021, 07:28 AM   #756
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,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Does restarting calibre make any difference?
capink is offline   Reply With Quote
Old 12-13-2021, 07:32 AM   #757
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Restarting Calibre worked. I actually noticed that some of my other custom functions were working and tried it just a minute or two before you posted.
ownedbycats is offline   Reply With Quote
Old 12-13-2021, 07:37 AM   #758
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,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
For now, whenever you create a new stored template, you will have to restart for it to work in Action Chains.

Last edited by capink; 12-13-2021 at 07:57 AM.
capink is offline   Reply With Quote
Old 12-13-2021, 07:40 AM   #759
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Would the issue also happen when a custom function is updated? Either breaking again or producing outdated results.
ownedbycats is offline   Reply With Quote
Old 12-13-2021, 07:54 AM   #760
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,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Unfortunately yes. I will examine this later today or tomorrow to see what can be done.

Edit: The problem is actually in the code of Action Chains not updating template functions. I will include a fix for this in the next version.

Last edited by capink; 12-13-2021 at 07:59 AM.
capink is offline   Reply With Quote
Old 12-19-2021, 12:15 PM   #761
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: Can Action Chains be made to sort a specific column in a specific order?

The calibre action for "sort by" (see attached chain) tends to be a bit flaky for doing this; if it's the current sort, the menu entries change and break validation, and there's no way to define ascending/descending.
Attached Files
File Type: zip ApplySort.zip (422 Bytes, 212 views)

Last edited by ownedbycats; 12-19-2021 at 12:20 PM.
ownedbycats is offline   Reply With Quote
Old 12-19-2021, 08:14 PM   #762
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,013
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
Quote:
Originally Posted by ownedbycats View Post
Question: Can Action Chains be made to sort a specific column in a specific order?
The View manager plugin can do that for the display at least.
It supports arbitrary multi-column sorts fully.
compurandom is offline   Reply With Quote
Old 12-19-2021, 11:34 PM   #763
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Unfortunately, VM doesn't support only sorting; you need to select columns too.
ownedbycats is offline   Reply With Quote
Old 12-20-2021, 08:17 AM   #764
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,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
Question: Can Action Chains be made to sort a specific column in a specific order?

The calibre action for "sort by" (see attached chain) tends to be a bit flaky for doing this; if it's the current sort, the menu entries change and break validation, and there's no way to define ascending/descending.
This will need a new action. I already have a sort dialog implemented in the advanced mode of the Find Duplicates plugin, will port it to Action Chains when I have the time to do the next release.
capink is offline   Reply With Quote
Old 12-20-2021, 09:49 AM   #765
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,035
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thank you.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Action Chains Resources capink Plugins 78 08-05-2025 04:01 AM
[Editor Plugin] Editor Chains capink Plugins 106 06-17-2025 05:36 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 12:22 AM.


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