Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-16-2021, 04:01 AM   #46
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,014
Karma: 7257321
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
You are missing end-of-statement semicolons on lines 5, 16, 23, and 30.
chaley is offline   Reply With Quote
Old 04-16-2021, 02:07 PM   #47
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: 9,486
Karma: 64500001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thank you That's a silly mistake
ownedbycats is offline   Reply With Quote
Advert
Old 04-17-2021, 01:41 PM   #48
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: 9,486
Karma: 64500001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: is there a way to check for a transient mark with a template? I would like to display a pushpin icon instead of polish.png.
ownedbycats is offline   Reply With Quote
Old 04-17-2021, 01:47 PM   #49
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,014
Karma: 7257321
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Question: is there a way to check for a transient mark with a template? I would like to display a pushpin icon instead of polish.png.
Do you mean this?
Code:
program:
	if is_marked() then 'marked.png' fi
chaley is offline   Reply With Quote
Old 04-17-2021, 01:50 PM   #50
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: 9,486
Karma: 64500001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
that works! Thank you
ownedbycats is offline   Reply With Quote
Advert
Old 04-17-2021, 06:26 PM   #51
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,981
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
Do you mean this?
Code:
program:
	if is_marked() then 'marked.png' fi
@chaley - curious: would that be the default marked.png or would it pick up the override at <config>/resources/images/marked.png

Also, I've 'acquired' a folder named tb_icons in <config>. I assume its where custom tab browser icons are stored. There is only one file in it: icon_#oncloud.png. However I restored the default icon for the oncloud category shortly after I added the custom icon, should the custom icon have been removed, along with the resultant empty tb_icons folder. I've deleted the folder will no ill effect.

BR
BetterRed is offline   Reply With Quote
Old 04-17-2021, 07:03 PM   #52
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: 9,486
Karma: 64500001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Does the column icons editor have access to anything outside of the cc_icons folder? That would be useful...
ownedbycats is offline   Reply With Quote
Old 04-17-2021, 07:27 PM   #53
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,981
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by ownedbycats View Post
Does the column icons editor have access to anything outside of the cc_icons folder? That would be useful...
For instance the icons in the Calibre install location:

You could try dropping a symlink to the png in <install location>\app\resources\images into the cc_icon folder, it may survive caiibre updates, whereas a hardlink probably wouldn't survive as a hardlink, but as a copy.

But if the symlink does survive an update and the icon changes in the update (e.g. to a flat escher-inspired etching), the symlink instance will change too, and that may not be desirable.

BR
BetterRed is offline   Reply With Quote
Old 04-17-2021, 11:24 PM   #54
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: 9,486
Karma: 64500001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Code:
{title_sort:'uppercase(re($, '^\W*(\w).*$','\1'))'}
For this, is it possible to combine digits to a single 0-9 category?
ownedbycats is offline   Reply With Quote
Old 04-18-2021, 02:01 AM   #55
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: 9,486
Karma: 64500001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Also, is there any particular advantages of an template rule with several if statements vs. several non-composed basic rules? The context is for my Cleanup VL:

Click image for larger version

Name:	2021-04-18 03_03_26-calibre - Preferences - Look & feel.png
Views:	909
Size:	64.5 KB
ID:	186667

I've got a template half-made but I am not sure if it is worth.

Last edited by ownedbycats; 04-18-2021 at 02:05 AM.
ownedbycats is offline   Reply With Quote
Old 04-18-2021, 03:56 AM   #56
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,014
Karma: 7257321
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
@chaley - curious: would that be the default marked.png or would it pick up the override at <config>/resources/images/marked.png
If the template is being evaluated in a column-icon context then the image file must be in 'config_dir/cc_icons'. I don't think there is a context where the template is returning the name of a 'standard' image, but if there is then the standard override rules would apply.
Quote:
Also, I've 'acquired' a folder named tb_icons in <config>. I assume its where custom tab browser icons are stored. There is only one file in it: icon_#oncloud.png. However I restored the default icon for the oncloud category shortly after I added the custom icon, should the custom icon have been removed, along with the resultant empty tb_icons folder. I've deleted the folder will no ill effect.
The custom icons and the containing folder (tb_icons, cc_icons) are not removed when they are no longer used. Doing so would be problematic because calibre can't know if a plugin uses the images. The folders themselves can be removed if they are empty, as calibre recreates them when needed.
chaley is offline   Reply With Quote
Old 04-18-2021, 03:57 AM   #57
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,014
Karma: 7257321
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Does the column icons editor have access to anything outside of the cc_icons folder? That would be useful...
No. Same for emblems.
chaley is offline   Reply With Quote
Old 04-18-2021, 03:59 AM   #58
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,014
Karma: 7257321
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Code:
{title_sort:'uppercase(re($, '^\W*(\w).*$','\1'))'}
For this, is it possible to combine digits to a single 0-9 category?
Sorry, but I don't understand what you want to do.
chaley is offline   Reply With Quote
Old 04-18-2021, 04:27 AM   #59
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,014
Karma: 7257321
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Also, is there any particular advantages of an template rule with several if statements vs. several non-composed basic rules? The context is for my Cleanup VL:
[...]
I've got a template half-made but I am not sure if it is worth.
It goes both ways.

First, note that all rules are templates. The templates for basic rules are generated by calibre.

So ...
  • A sequence of basic rules will be slightly faster if the first rule succeeds almost all the time, e.g., 99%.
  • A single template will be faster if the succeeding rule isn't usually the first because it avoids the overhead of sequentially executing the basic templates looking for a result.
  • There are many situations where an advanced rule is needed, such as when you need the "or" of conditions. Basic rules implement 'and'.
  • Depending on what you are doing, one technique or the other might be easier to understand and maintain.
  • And finally, you might prefer one over the other.
FWIW: a sequence of non-composed rules is equivalent to a single template that returns the first qualifying result. For example, assume you want a 'foo.png' icon on the author column if the author is "Joe Blogs" but a 'bar.png' icon if the author is 'Fred Flintstone'. This could be done with two non-composed basic rules, or with this template:
Code:
program:
	if str_in_list($authors, '&', 'Joe Blogs', '1', '') then return 'foo.png' fi;
	if str_in_list($authors, '&', 'Fred Flintstone', '1', '') then return 'bar.png' fi
The template is easier if the searched field is comma separated, for example tags, because you can use the 'inlist' operator. Assuming you are searching for 'ondevice' or 'bar', the template would be:
Code:
program:
	if '^ondevice$' inlist $tags then return 'foo.png' fi;
	if '^bar$' inlist $tags then return 'bar.png' fi;
chaley is offline   Reply With Quote
Old 04-18-2021, 01:06 PM   #60
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: 9,486
Karma: 64500001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by chaley View Post
Sorry, but I don't understand what you want to do.
Sorry, not too clear. Currently this returns the first alphanumeric character of title_sort. I thought it'd be possible to combine all the numeric characters into a single 0-9 category.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Library Management: various questions not worth their own thread ownedbycats Library Management 168 10-26-2024 12:12 PM
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates Boilerplate4U Development 13 07-07-2020 02:35 AM
Questions on Kobo [Interfered with another thread topic] spdavies Kobo Reader 8 10-12-2014 11:37 AM
[OLD Thread] Some questions before buying the fire. darthreader13 Kindle Fire 7 05-10-2013 09:19 PM
Thread management questions meme Feedback 6 01-31-2011 05:07 PM


All times are GMT -4. The time now is 07:37 AM.


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