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 12-20-2020, 02:55 PM   #1
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,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Combining multiple "fewer days ago then" colour rules

I have these three rules:

Click image for larger version

Name:	2020-12-20 15_51_42-calibre - Preferences - Look & feel.png
Views:	236
Size:	47.8 KB
ID:	184148

It's intended to make it easier to know at a glance which of my "recently updated fanfics" (>7daysago) is the newest:

Click image for larger version

Name:	2020-12-20 15_53_43-Window.png
Views:	247
Size:	15.1 KB
ID:	184149

To make it easier to apply to other columns, how would I combine this into a single advanced rule while keeping the order of precedence?

Thank you!
ownedbycats is online now   Reply With Quote
Old 12-20-2020, 06:25 PM   #2
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,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Wait for the next release, then:
  1. Convert the rules to advanced rules. You might want to duplicate them first. This will give you a rule that uses test(and...
  2. Create a new advanced rule containing a "first_non_empty() function.
  3. Copy the "test...and" lines and paste them as items in the first_non_empty in the order you want.
For example, given this advanced rule:
Code:
program:
test(and(
         strcmp(field('#enum2'), "no", '', '1', ''),
         strcmp(field('#enum3'), "no", '', '1', '')
    ), 'cry-icon.png', '');
the advanced rule with first_non_empty would be
Code:
program:
first_non_empty(
    test(and(
         strcmp(field('#enum2'), "no", '', '1', ''),
         strcmp(field('#enum3'), "no", '', '1', '')
    ), 'cry-icon.png', '')
)
If I (for example) add another branch to first_non_empty then it becomes
Code:
program:
first_non_empty(
    test(and(
         strcmp(field('#enum2'), "no", '', '1', ''),
         strcmp(field('#enum3'), "no", '', '1', '')
    ), 'cry-icon.png', ''),
    test(and(
         strcmp(field('#bar'), "no", '', '1', ''),
         strcmp(field('#flapjack'), "no", '', '1', '')
    ), 'foo.png', '')
)
chaley is offline   Reply With Quote
Advert
Old 12-20-2020, 06:40 PM   #3
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,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thanks for implementing the 'convert to advanced rules' for next release, btw I learn a bit better by seeing examples.

Last edited by ownedbycats; 12-20-2020 at 07:26 PM.
ownedbycats is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre-generated epub (from .docx) gives "e21027" "multiple opf files" on KindleGen GhostRider Conversion 2 08-28-2024 10:14 AM
Add "font-size" and "font-colour" functions to next version of Page Edit? hhtmp88 Sigil 6 08-20-2020 03:09 PM
hierarchy feature using rough "Dewey number" instead of "genre" - multiple DDCs? kite Library Management 4 10-13-2014 09:53 AM
"Multitasking Moms Endorse The KOBO VOX Colour eReader" scrapking Kobo Tablets 0 03-16-2012 12:33 PM
"Stretching crystals promises flexible colour displays" jharker News 13 09-05-2007 12:03 PM


All times are GMT -4. The time now is 03:40 PM.


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