![]() |
#781 | |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
Quote:
Look&Feel -> Book Details -> Create rules |
|
![]() |
![]() |
![]() |
#782 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
@chaley: I went from this on my "Info" column displayed along with Comments field...
📂 {title} by {author} 🔢 {#abc_numeric} 🏚️ Published in {pubdate} by {publisher} 📚 {#pc} 🗓️ TS: {date} 🗓️ LA: {#la} 🗓️ LV: {#last_viewed} ISBN: {identifiers:select(isbn)} 👍Votes: {#v} 👍Rating: {#rr} 🌍 {languages} to this: program: out = '📂 ' & $title & ' by ' & $author & ' 🔢 ' & $#abc_numeric & ' 🏚️' & if field('pubdate') then 'Published in ' & field('pubdate') else '' fi & if field('publisher') then ' by ' & field('publisher') else '' fi & ' 📚 ' & $#pc & ' 🗓️ TS: ' & $date & if field('#la') then ' 🗓️ LA: ' & field('#la') else '' fi & if field('#last_viewed') then ' 🗓️ LV: ' & field('#last_viewed') else '' fi & if select($identifiers, 'isbn') then ' 🆔 ISBN: ' & select($identifiers, 'isbn') else '' fi & if field('#v') then ' 👍Votes: ' & field('#v') else '' fi & if field('#rr') then ' 👍Rating: ' & field('#rr') & if field('languages') then ' 🌍 ' & field('languages') else '' fi else '' fi WITHOUT AI... so my head is ![]() ![]() The output in Book Details looks like this: 📂 Nineteen eighty-four by George Orwell 🔢 91 🏚️Published in August 2001 by Project Gutenberg of Australia 📚 3 🗓️ TS: 03-09-2024 05:49 🗓️ LA: 22-Jan-2025 15:20 🗓️ LV: 22-01-2025 15:20 🆔 ISBN: 9780241453513 👍Votes: 4800394 👍Rating: 4.19 🌍 eng And I also have that other secondary Info column you helped me with the other day, like this: program: out = ' 💾 '; fmts = list_sort(formats_sizes(), 0, ',') ; for fmt_data in fmts: fmt = sublist(fmt_data, 0, 1, ':'); size = sublist(fmt_data, 1, 2, ':'); str = if size ># 0 then strcat(fmt, ': ', human_readable(size), ' | ') else '' fi; out=strcat(out, str) rof; if substr(out, -2, 0) == '| ' then out = substr(out, 0, -3) fi; out & strcat( if field('#li') then ' ✍️ ' & field('#li') else '' fi, if field('#fav') then ' ⭐: y ' & field('') else '' fi, if field('#pp') then ' 📈 ' & field('#pp') & ' pages' else '' fi, if field('#words') then ' | ' & field('#words') & ' words' else '' fi, if field('#ac') then ' 🟨 ' & field('#ac') else '' fi , if field('series') then ' ▶️ ' & field('series') & ' - ' & field('series_index') else '' fi ) this one outputs: 💾 EPUB: 295.7 KB | ORIGINAL_PDF: 1.6 MB | PDF: 767.9 KB ✍️ https://www.goodreads.com/author/sho....George_Orwell ⭐: y 📈 484 pages | 103,810 words 🟨 16 I'm finding it fun to assemble these templates but I'd be happy to receive some feedback on overall syntax and alternatives to simplify the code or perhaps convert it to PTM ![]() (the main purpose is to make room for my author Bio column but I also find those lines useful to spot at a glance what metadata is missing that I would like to have displayed) Last edited by Comfy.n; 01-24-2025 at 07:07 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#783 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,458
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
For the first template, replace bits that look like Code:
if field('pubdate') then 'Published in ' & field('pubdate') else '' fi Code:
if v = field('pubdate') then 'Published in ' & v fi
For the second template, for the bits that look like this: Code:
if field('#li') then ' ✍️ ' & field('#li') else '' fi, Code:
do_field('#li', ' ✍️ ') Code:
def do_field(field_name, icon): return (if v = field(field_name) then icon & v fi) fed;
|
|
![]() |
![]() |
![]() |
#784 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
Thanks! I'm going to take a careful look at your recommendations later. Since you find that hard to read (it is, undoubtedly, but... that's how I managed to do the concatenations), I guess you'll find my "icons" column rule unimaginably chaotic:
Spoiler:
![]() |
![]() |
![]() |
![]() |
#785 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,458
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
For performance reasons I would suggest the following small modification. Instead of lines like this: Code:
if 'EPUB' in $#f then icon = add_icon(icon, 'formats_epub.png') fi; if 'AZW3' in $#f then icon = add_icon(icon, 'formats_azw3.png') fi; Code:
f = $#f; if 'EPUB' in f then icon = add_icon(icon, 'formats_epub.png') fi; if 'AZW3' in f then icon = add_icon(icon, 'formats_azw3.png') fi; If you would accept alphabetic order instead of your if statement order then this would replace the long block of ifs. It isn't any faster but it is much more concise. Code:
for f in $#f: icon = add_icon('formats_' & lowercase(f)) rof |
|
![]() |
![]() |
Advert | |
|
![]() |
#786 | |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
Quote:
Code:
program: def do_field(field_name, icon, something, something2): return (if v = field(field_name) then icon & v & something & something2 fi) fed; out = ' 💾 '; fmts = list_sort(formats_sizes(), 0, ',') ; for fmt_data in fmts: fmt = sublist(fmt_data, 0, 1, ':'); size = sublist(fmt_data, 1, 2, ':'); str = if size ># 0 then strcat(fmt, ': ', human_readable(size), ' | ') else '' fi; out=strcat(out, str) rof; if substr(out, -2, 0) == '| ' then out = substr(out, 0, -3) fi; out & strcat( do_field('#li', ' ✍️ '), do_field('#fav', ' ⭐:'), do_field('#pp', ' 📈 ', ' pages') , do_field('#words', ' 📈 ', ' words') , do_field('#ac', ' 🟨 '), do_field('#ot', ' 🌱 '), do_field('#tr', ' 🌐'), do_field('series', ' ▶️ ', ' - ' , field('series_index')) ) ![]() |
|
![]() |
![]() |
![]() |
#787 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,458
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
![]() I'll start sending template questions to you! ![]() What you did with the 'somethings' is what I would have done. A reasonable alternative is a second function. The first wouldn't have the 'somethings' and the second would. The reason to do this is if the processing is different if the 'somethings' exist. |
|
![]() |
![]() |
![]() |
#788 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
|
![]() |
![]() |
![]() |
#789 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 897
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
Very good idea !!! |
|
![]() |
![]() |
![]() |
#790 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
What I'm enjoying most is the possibility of having both my Comments/blurb custom column (which mirrors the built-in one) and the Author Bio displayed together.
It wouldn't make sense to me to use the Narrow interface layout by default until I found just recently that it's possible to display the output of templates in the comments section of book details. Also, I had assigned two custom layouts called "down" and "right" when the Layout Actions feature was released and would need to alternate between them sometimes. Now I've settled down with BD on bottom of the UI and i'm very satisfied with it. ![]() ![]() |
![]() |
![]() |
![]() |
#791 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 897
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
Implemented, thanks Last edited by dunhill; 01-26-2025 at 12:58 PM. |
|
![]() |
![]() |
![]() |
#792 | |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
Quote:
As to the new Category custom icons for the Tag Browser, this feature is already available on latest preview |
|
![]() |
![]() |
![]() |
#793 |
Leftutti
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
Hey Comfy.n, can you still navigate in Calibre or can you make yourself a coffee after every change?
That's why I've stopped listing everything down to the author's shoe size. ![]() But if the madness should take hold of me again, I'll still be happy to help myself here - thank you. |
![]() |
![]() |
![]() |
#794 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,779
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Those key sequences are my assignments. BR |
|
![]() |
![]() |
![]() |
#795 | ||
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,615
Karma: 7891011
Join Date: Sep 2020
Device: none
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 227 | Yesterday 05:28 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 |