![]() |
#1 |
Blue. Not sad...just blue
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
|
Emblems: Series number?
Is there a way to set an emblem for a specific number of a book's series? e.g. a "7" graphic for book 7.
I've tried this, but to no avail: Code:
If the series column matches pattern... 1 of Series Name
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,265
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Assuming you have added images name 1.png, 2.png etc
you'd have to create an advanced mode rule that evaluates to the approporiate image name. Unfortunately, I dont have the time right now to create the rule for you. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,383
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The template for the advanced rule would be something like this
Code:
program: s = field('series_index'); first_non_empty( cmp(s, 1.01, '1.png', '', ''), cmp(s, 2.01, '2.png', '', ''), cmp(s, 3.01, '3.png', '', ''), cmp(s, 4.01, '4.png', '', ''), cmp(s, 5.01, '5.png', '', ''), cmp(s, 6.01, '6.png', '', ''), cmp(s, 7.01, '7.png', '', ''), cmp(s, 8.01, '8.png', '', ''), cmp(s, 9.01, '9.png', '', ''), cmp(s, 9.99, '', '', 'bigger.png') ) |
![]() |
![]() |
![]() |
#4 |
Blue. Not sad...just blue
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
|
Thanks for the answers. I'm still banging my head against 2 things:
Basically I'm just overall confused. ![]() |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,383
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Do you already have icon files named 1.png, 2.png, etc? If you do not then the advanced rule I supplied will do nothing. And in any event the template should be: Code:
program: s = field('series_index'); test(field('series'), first_non_empty( cmp(s, 1.01, '1.png', '', ''), cmp(s, 2.01, '2.png', '', ''), cmp(s, 3.01, '3.png', '', ''), cmp(s, 4.01, '4.png', '', ''), cmp(s, 5.01, '5.png', '', ''), cmp(s, 6.01, '6.png', '', ''), cmp(s, 7.01, '7.png', '', ''), cmp(s, 8.01, '8.png', '', ''), cmp(s, 9.01, '9.png', '', ''), cmp(s, 9.99, '', '', 'bigger.png') ), '') |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Blue. Not sad...just blue
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
|
I have my emblem files named to match your code, and just in case something was messed up with what I'd done before, created a new rule with just the code pasted in. I had to select something in the Column field for it to save the rule so I selected Series.
Still no effect. ![]() |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,383
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Verify that the files 1.png ... are in the right directory. They must be in [Calibre configuration directory]/cc_icons. One way to do this verification is to click on the down-arrow in the box next to "Copy an icon file name to the clipboard" and see what it shows you. You can go look at the directory by clicking on Preferences / Miscellaneous / Open calibre configuration directory, then clicking on cc_icons. Another test you can do is click on that same down arrow, select an image name, click on the clipboard button, then paste that image name over the top of 1.png. The template value should change and that image should appear on some books. Last test: insert a standard rule putting an emblem on books if series is set. That will test the underlying mechanism and demonstrate that emblems work at all. |
|
![]() |
![]() |
![]() |
#8 |
Blue. Not sad...just blue
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
|
Saints be praised, that was it!
I just had to put the icons in ~/Library/Preferences/calibre/cc_icons. Makes sense that it might want to know where they are, yup. Just yelling "With all the other ones, you fool!" didn't work for some reason. Silly computers. Also good to know that the "Template value" is giving the result of the calculation. Now I know how to know if it's working or not. Thanks for your help, chaley, Kovid! |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cover emblems - Where to get? | delaing | Calibre | 10 | 10-22-2014 07:37 PM |
Can Series number be more than one number? | icaria | Library Management | 8 | 12-27-2013 02:05 AM |
Series and Number | Spur52 | Library Management | 5 | 09-16-2011 08:06 PM |
Show series number but not if they aren't in a series? | M4cc45 | Library Management | 10 | 09-03-2011 07:35 PM |
What is the number in series name? | coredump | Calibre | 1 | 12-21-2009 10:51 AM |