![]() |
#151 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: $$#pagecount / 320 Code:
program: floor($$#pagecount / 320) Code:
program: round($$#pagecount / 320) Last edited by chaley; 09-24-2021 at 11:09 AM. Reason: Grammar |
|
![]() |
![]() |
![]() |
#152 |
Connoisseur
![]() Posts: 93
Karma: 10
Join Date: Jun 2011
Location: Albany NY
Device: Moonreader+
|
capink, Thanks again for helping me out, I promise it won't be a daily occurrence.
Using your code a box popped up with the correct # of minutes, but I'd like to assign that number to my custom column #minutes is that possible? Thanks Chaley I went with round($$#pagecount / 320) Last edited by kevn57; 09-24-2021 at 11:08 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#153 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#154 |
Connoisseur
![]() Posts: 93
Karma: 10
Join Date: Jun 2011
Location: Albany NY
Device: Moonreader+
|
Sorry chaley, I have a custom column called Minutes, I'd like to assign the result of round($$#pagecount / 320) to that column.
In this particular case it 53062 / 320 the result of round($$#pagecount / 320) is 166. Is there a way to put that number in my list view column #minutes. I can do it by hand but it'd be great to have it automatically inserted. |
![]() |
![]() |
![]() |
#155 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
There's two ways to do this: a composite or using Action Chains to populate the column. The first one means it'll automatically update, but can't be manually tweaked (there's also performance to think about, but that's for stuff far more complex than this). The latter you'll need to run the chain if you want to update it but if you want to change it to something else you can.
|
![]() |
![]() |
Advert | |
|
![]() |
#156 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
For the second you need to ask in the Action Chains plugin thread. What you do depends on how and when you want it updated. Last edited by chaley; 09-24-2021 at 11:30 AM. Reason: More precision on changing a composite's value |
|
![]() |
![]() |
![]() |
#157 |
Connoisseur
![]() Posts: 93
Karma: 10
Join Date: Jun 2011
Location: Albany NY
Device: Moonreader+
|
Thank you all I went with Column built from other columns because I do not want the values to change I want it tied to Pagecount and it worked perfectly. Now I can see at a glance approximately how long it'll take to read the book
|
![]() |
![]() |
![]() |
#158 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: Is there any sort of template function that returns the count of how many books are currently marked? For Action Chain conditions (run "clear all marked books" if there's only 1 marked book).
|
![]() |
![]() |
![]() |
#159 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Try this:
Code:
program: marked = from_search('id', 'marked:true'); count(marked, ',') Last edited by capink; 09-30-2021 at 09:58 AM. |
![]() |
![]() |
![]() |
#160 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
It works perfectly
![]() |
![]() |
![]() |
![]() |
#161 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question. Here's my "Update Kobo Path" template in my send-to-device chains:
Code:
program: if $#kobopath == '' then # Returns 'Fanfiction.Fandom' for fanfics if $$#fanficcat then re(sublist($tags, 0, 1, ','), '\.', '/') # Returns 'PDF' for PDFs elif $formats == 'PDF' then 'PDF' # Returns 'Loans' for Loans elif $#kobostatus == 'On Loan' then 'Loans' # Returns topmost tag for all other books else re(sublist($tags, 0, 1, ','), '^(.*?)($|\..*$)', '\1') fi else $#kobopath fi Last edited by ownedbycats; 10-01-2021 at 07:16 AM. |
![]() |
![]() |
![]() |
#162 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
sublist($tags, 0, 1, ',') If order must be known then you need to sort the tags before the sublist. Or strip out the tags you don't want to return. Or do something else to get the tag you actually want. |
|
![]() |
![]() |
![]() |
#163 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That makes sense. I think the easiest solution would to make it only run on tags starting with Fanfiction. (with the dot). Having a bit of trouble with the regex though.
![]() Code:
program: if $$#fanficcat then re(sublist($tags, 0, 1, ','), 'Fanfiction\.', 'Fanfiction/') fi |
![]() |
![]() |
![]() |
#164 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
if '^Fanfiction\.' inlist $tags then 'Fanfiction/' fi. Code:
list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1') |
|
![]() |
![]() |
![]() |
#165 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Fanfiction.subtag-> Fanfiction/subtag is what I'm trying to do yes. I will try the second one
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 225 | 07-27-2025 02:07 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 |