![]() |
#1 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jul 2015
Device: Android tablet
|
Author Emblems
I need help.
Among other things, I trying that in cover grid Calibre displays authors pics as emblems, and I like it. Problem is basic rule is ok for few authors, but how to implement that to my main library that has 10k+ authors. I would need 10k+ rules ![]() How to create advanced rule that would show author image if name of image is equal to authors name. example of basic rule: program: test(str_in_list(field('authors'), '&', "Andy Weir", '1', ''), 'andy weir.png', ''); |
![]() |
![]() |
![]() |
#2 |
Chalut o/
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 439
Karma: 145424
Join Date: Dec 2017
Device: Kobo
|
For only the first author:
Code:
program: list_item($authors, 0, '&') & '.png' Get emblems for all authors [composed icons]: Code:
program: rslt=''; authors = $authors; rslt = list_item(authors, 0, '&') & '.png'; for i in range(1, list_count(authors, '&')): if i == 6 then break fi; rslt = rslt & ':' & list_item(authors, i, '&') & '.png' rof; return rslt (the colon is for separate the individual icons. You can limite the number of emblems display by changing the number 6) EDIT: the case does not matter. Last edited by un_pogaz; 09-21-2022 at 12:52 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jul 2015
Device: Android tablet
|
Thank you
It works perfectly, and with little tweaking I can use it for whole lots of other things, like with custom column awards i can show award icon if book has some awards and so much more....
Thank you so much. ![]() ![]() |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 885
Karma: 409970
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
What size should the png with the author's name be?
|
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jul 2015
Device: Android tablet
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jul 2015
Device: Android tablet
|
Thank you again your solution is great,
and I did manage to adjust it for my custom #awards column. But then i got greedy, instead of two columns, one for awards and one for award year, which works with your solution. I tried hierarchical for awards: hierarchy being awards.year and I don't know how to add wildcards to rule. |
![]() |
![]() |
![]() |
#7 | |
Member
![]() Posts: 11
Karma: 10
Join Date: Jul 2015
Device: Android tablet
|
![]() Quote:
but if book has more than one award, you have to use hierarchy. |
|
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jul 2015
Device: Android tablet
|
think it could be done with command shorten,t o shorten #awards by 5 letters, but to the likes of me whatever I, try its not working.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Misaligned emblems | ownedbycats | Library Management | 0 | 12-11-2021 02:22 AM |
Emblems | BigGeeNotts | Calibre | 3 | 10-20-2018 05:25 PM |
Cover emblems - Where to get? | delaing | Calibre | 10 | 10-22-2014 07:37 PM |
Which are your emblems? | Ansem_93 | Library Management | 1 | 10-19-2014 06:03 AM |
Emblems: Series number? | Snorkledorf | Calibre | 7 | 08-29-2014 09:43 AM |