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 01-26-2021, 11:25 AM   #301
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
My bad. I looked at the release notes and must have missed it. I don't usually update to every new calibre release.
The changes weren't mentioned in the release notes. I suspect Kovid considered them to more technical- than user-oriented.

Also in the release:
  • the field_exists() function
  • add() & multiply() now take as many arguments as you wish.
chaley is offline   Reply With Quote
Old 01-26-2021, 01:30 PM   #302
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,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by capink View Post
Update: Allow hiding menu entries by putting them in a submenu called invisible.
Thank you for this!

Is "invisible" supposed to be case-sensitive? I had the first letter capitalized and it didn't work.
ownedbycats is online now   Reply With Quote
Old 01-26-2021, 02:12 PM   #303
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
Yes. Could be made case-insensitive in future releases.
capink is offline   Reply With Quote
Old 02-04-2021, 10:14 PM   #304
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.0.0

Version 1.0.0
  • Update: Allow Nested sub-menus by using ::: as a separator.
  • Fix: Single Field Edit: Bug checking enum types when applying templates.
  • Fix: Importing entries should not allow duplicate chain names as it leads to errors when menus are re-built.
capink is offline   Reply With Quote
Old 02-05-2021, 02:17 PM   #305
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,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
congratulations for hitting version 1.0!
ownedbycats is online now   Reply With Quote
Old 02-05-2021, 09:56 PM   #306
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,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
A very small UI error, and likely not worth fixing:

When adding a new action to a chain, clicking on the dropdown menu and then immediately alt-tabbing away results in it getting set to "None," which causes a bunch of key errors.
ownedbycats is online now   Reply With Quote
Old 02-05-2021, 11:54 PM   #307
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
congratulations for hitting version 1.0!
Thanks. You helped immensely with your feedback.
capink is offline   Reply With Quote
Old 02-11-2021, 09:05 PM   #308
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,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: How would I set up a template for single-field edit to add an entry to a tag-like?

I have a tag-like #kobocoll for Kobo collections. I'd like to add certain entries depending on the presence of certain entries in #genre column - e.g. if "fantasy" or "science fiction" are present, add "Fantasy & Sci-Fi" to #kobocoll.

thank you!
ownedbycats is online now   Reply With Quote
Old 02-12-2021, 01:42 AM   #309
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
Question: How would I set up a template for single-field edit to add an entry to a tag-like?

I have a tag-like #kobocoll for Kobo collections. I'd like to add certain entries depending on the presence of certain entries in #genre column - e.g. if "fantasy" or "science fiction" are present, add "Fantasy & Sci-Fi" to #kobocoll.

thank you!
It would be something along those lines ...

Code:
program:
	genre = field('#genre');
	kobocoll = field('#kobocoll');
	intersection = list_intersection(genre, 'fantasy,science-fiction', ',');
	if intersection == '' then
		kobocoll
	else
		strcat(kobocoll, ',Fantasy & Sci-Fi')
	fi
Edit: The template processor in single field edit has been modified to do the following:
  • If the template returns a value identical to the current value, it will be discarded and no change will happen.
  • If the template returns an empty string, the plugin will unset the column value. This includes all data types (text, numerals, dates ... etc)

Last edited by capink; 02-12-2021 at 11:57 PM.
capink is offline   Reply With Quote
Old 02-12-2021, 06:10 AM   #310
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
It would be something along those lines ...

Code:
program:
	genre = field('#genre');
	kobocoll = field('#kobocoll');
	intersection = list_intersection(genre, 'fantasy,science-fiction', ',');
	if intersection == '' then
		strcat(kobocoll)
	else
		strcat(kobocoll, ',Fantasy & Sci-Fi')
	fi
FWIW: the line 'strcat(kobocoll)' can be written simply as 'kobocoll'.
chaley is offline   Reply With Quote
Old 02-12-2021, 07:04 AM   #311
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
modified.
capink is offline   Reply With Quote
Old 02-12-2021, 10:57 AM   #312
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.1.0

Version 1.1.0
  • Fix: Single Field Edit: Don't update column value if template returns a value identical to the current value.
capink is offline   Reply With Quote
Old 02-12-2021, 11:22 AM   #313
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.1.1
  • Update: Single Field Edit: Setting template output to empty string deletes the column value for all datatypes.

Last edited by capink; 02-12-2021 at 01:09 PM.
capink is offline   Reply With Quote
Old 02-12-2021, 07:27 PM   #314
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,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thank you!
ownedbycats is online now   Reply With Quote
Old 02-13-2021, 07:01 AM   #315
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
There is a problem with the selection modifier that needs addressing. The search option in the selection modifier did not take into account that some people might have the search highlight option enabled. So if someone with highlight option enabled, decided to use a new or saved search in the selection modifier, and checked the option to select all books in current view, it would actually select all books in the library, since that is the current view (unlike what happens if you do the same steps with the highlight option turned off).

There are two ways to deal with this:
  1. Keep the selection modifier action as it is, but temporarily set the highlight feature off and restore it back after the action finishes. The advantage to this is that it is will not break settings configured with older versions. The code for this is already present in the Find Duplicates plugin, so it should be very easy to add.
  2. Modify the selection modifier to directly select the books from a search without adding the new search to the search bar and without changing the current view. The selection is going to be within the confines of any previous search or virtual library (the option to clear any search or virtual libraries will still be included).

    The advantage to this option is that it is cleaner, and the selection modifier should have been implemented this way from the start. The main problem with this approach; is that it will break actions configured with previous versions of the plugin.

    Also since the selection modifier will not add the new search to the search bar, and consequently will not change the book view to reflect the chosen search, I can compensate for this by incorporating this previously posted custom action, as a built-in action in the plugin.

I am leaning towards the second solution, but since it breaks compatibility, I decided to post here first to seek input from others. As a transitional step, I might post a new version that implements the first solution, and then decide whether to pursue the second option or not.

Last edited by capink; 02-13-2021 at 08:01 AM.
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 06:03 PM.


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