10-20-2021, 12:16 AM | #916 |
Custom User Title
Posts: 8,545
Karma: 61120499
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
For those who read fanfics on a Kobo, here's something you can put in a composite column to show how many chapters you've read of a fic as of the last time you connected the device. Note that this relies on using Kobo Utilities and FanFicFare; read the comments for more details.
Code:
program: # 'Current reading location' stored by Kobo Utilities. input = $#kobobookmark; # These last three are saved by FanFicFare. fandom = $#fanficcat; status = $#fanficstatus; ccount = $$#chaptercount; if fandom then if # Note that this is FanFicFare's file structure. If you download with a different tool, it may not work. substr(input, 0, 10) == 'OEBPS/file' && # Anthologies have a different file structure, so we should ignore those. !status inlist 'Anthology' then # Since I pause at the beginning of chapters, I subtract by one. strcat(format_number(re(input, '.*\/file(\d+).*', '\1') - 1, '{0:,d}'), '/',ccount) else # Showing a regular chapter count for everything else. ccount fi fi Last edited by ownedbycats; 10-20-2021 at 12:58 AM. |
02-03-2022, 05:47 PM | #917 |
Junior Member
Posts: 1
Karma: 10
Join Date: Feb 2022
Device: Kindle2 (KB)
|
Explain me the plugboard
Hi, is there any regex guru who can help me to understand plugboard template "Show author name as Initial and Surname (Kindle) (inspired by brewjono)"? Im afraid i dont fully understand the syntax:
Code:
{author_sort:re(\, (.).*?( &|$),\, \1\2)} How the regex matches the string and how replaces the field? |
Advert | |
|
02-03-2022, 06:10 PM | #918 | |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Where are you seeing the result you say you get? If it is on a device then the device is changing it. Nothing the plugboard can do about that. Workarounds might be available but you should ask in the devices forum, naming your device. |
|
02-19-2022, 02:59 PM | #919 |
Guru
Posts: 720
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
Hello people
I have this configuration to save to disk. {title} ({#id}) - {authors} But the ID comes out with decimals, how could I fix it so that it is a whole number example: Title (10017301.0) - author.epub |
02-19-2022, 03:16 PM | #920 | |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
My guess is that {title} ({id}) - {authors} will work. |
|
Advert | |
|
02-19-2022, 03:24 PM | #921 | |
Guru
Posts: 720
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
For that reason # My mistake, for not seeing. Sorry Last edited by dunhill; 02-19-2022 at 03:33 PM. |
|
02-19-2022, 03:32 PM | #922 |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
02-19-2022, 04:30 PM | #923 | |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
{title} ({#id:15.15g}) - {authors} |
|
02-19-2022, 09:24 PM | #924 |
Guru
Posts: 720
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
|
02-20-2022, 01:51 PM | #925 |
Guru
Posts: 720
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
I have a question about the id.
Let's suppose that I have an id that by order is added 100000000 Example: Original id 043579 + added 100043579 Question by means of a disk saving template could I get back the original id or a personal column by means of program: ? Example: id 100043579 - added 100000000 = id Original 043579 Last edited by dunhill; 02-20-2022 at 01:54 PM. |
02-20-2022, 03:45 PM | #926 | |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: $#id - 100000000 I suggest you look at the template language documentation. |
|
02-20-2022, 04:26 PM | #927 | |
Guru
Posts: 720
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
Thanks because I was thinking about it with this post and it was simpler https://www.mobileread.com/forums/sh...17&postcount=8 Well not everything can be perfect. First of all I must say that I lack command of pyton, how could you add conditionals. Example: what remains if the number is between 10000000 and 10999999 only Last edited by dunhill; 02-20-2022 at 06:33 PM. |
|
02-21-2022, 10:33 AM | #928 |
Custom User Title
Posts: 8,545
Karma: 61120499
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Something like this should work.
Code:
program: ## obviously replace $#yournum with your column if $#yournum>=#10000000 && $#yournum<=#10999999 then ## using 'round' to fix the float/decimal output I got in my test round(subtract($#yournum, 100000000)) else $#yournum fi Last edited by ownedbycats; 02-21-2022 at 10:35 AM. |
02-21-2022, 05:06 PM | #929 | |
Guru
Posts: 720
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
Thank you very much, that solves the problem |
|
03-16-2022, 08:30 AM | #930 |
Custom User Title
Posts: 8,545
Karma: 61120499
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I use this as a stored template, readstatus().
Note that #percentread is integer and #readinglist is series-like managed with the Reading List plugin. Code:
program: if $$#percentread >=#1 && $$#percentread <=#99 then 'currentlyreading' elif "To Be Read" in $#readinglist && $$#percentread ==#0 then 'toberead' elif $$#percentread >=#100 then 'read' elif $$#percentread == 'None' then 'undefined' elif $$#percentread >=#0 then 'unread' fi It would probably also work as a composite column. Last edited by ownedbycats; 03-16-2022 at 10:18 AM. |
Tags |
custom column, tag, tags |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |