![]() |
#406 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
@ownedbycats solution works for books that have one or the other format. If a book has both and you choose the format when you send to device then it won't give you joy. However, if you let calibre choose by priority then you can build that same priority into the template. I haven't looked at file name template processing for years. Now that we have template global variables I might be able to pass the format extension there. EDIT: No can do. The file path is generated before the extension is chosen. Last edited by chaley; 05-25-2022 at 05:59 AM. |
|
![]() |
![]() |
![]() |
#407 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Yah, I was working off the assumption that Vespero would have only cbz for the comics (seeing as comics don't tend to work well as epubs).
Last edited by ownedbycats; 05-25-2022 at 08:13 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#408 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: May 2022
Device: Kindle Paperwhite 5
|
Quote:
The composite column sounds like a great idea! I just use epub and cbz so I'd only need two entries (well, I guess a third in the case of exceptions). I'm pretty bad at programming but I'll do some testing, thanks! |
|
![]() |
![]() |
![]() |
#409 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
strcat: What would be the best way to add the comma separators here? I thought of "if id then output" but that seems clumsy.
Last edited by ownedbycats; 05-26-2022 at 02:53 PM. |
![]() |
![]() |
![]() |
#410 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: list_join( ',', if x then urls_from_identifiers('foo:bar', 0) fi, ',', if y then urls_from_identifiers('mumble:fratz', 0) fi, ',') |
|
![]() |
![]() |
Advert | |
|
![]() |
#411 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
list_join works, though I had to set the separator to ', ', (with an additional whitespace character); unsure if that's intended behaviour so I'm noting it.
|
![]() |
![]() |
![]() |
#412 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You need to do that only if you want to see a space after the comma. The space isn't needed for anything except its appearance.
|
![]() |
![]() |
![]() |
#413 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I just noticed that without the additional space it lumped together like 'Goodreads,Fantastic Fiction,Google."
|
![]() |
![]() |
![]() |
#414 | ||
Junior Member
![]() Posts: 6
Karma: 10
Join Date: May 2022
Device: Kindle Paperwhite 5
|
Quote:
I have a column (lookup is "path") set to: Code:
program: if 'cbz' in approximate_formats() then 'books/{author_sort}/{series}/{title}' else 'books/{author_sort}/{series}/{series}{series_index:0>2s| - | - }{title}' fi I believe this is what the manual warns against in the bolded text: Quote:
Or is the issue with the fact that the variables in the column are showing as variables and not actually displaying the information they should point to? I guess that should have been my first hint that something was wrong. Some quick Googling did not turn up an example of a column formed from multiple variables that I could use as a base. (I'd do more experimentation and research on my own but I'm unfortunately about to be out of the house and extremely busy for the next week and don't have the time, so sorry if this is an obvious mistake on my part) |
||
![]() |
![]() |
![]() |
#415 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
This should do it. The spacing might be wrong. Code:
program: if 'cbz' in approximate_formats() then strcat('books/', $author_sort, '/', $series, '/', $title) else strcat('books/', $author_sort, '/', $series, '/', $series, finish_formatting($series_index, '0>2s', ' - ', ' - '), $title) fi |
|
![]() |
![]() |
![]() |
#416 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: May 2022
Device: Kindle Paperwhite 5
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#417 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: Could book_values be used to check how many books in a series have a #percentread of 100, compare that to the number of books in the series, then return a value (e.g. read series, unread series, partially read series) based on that?
I think this would probably be best done as a template search. |
![]() |
![]() |
![]() |
#418 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: vals = globals(vals = ''); if !vals then all_series = book_values('series', 'series:true', ',', 0); for series in all_series: count = book_count('series:="' & series & '"', 0); reads = book_values('#myint', 'series:="' & series & '"', ',', 0); ans = ''; # I assume that an unread book has an undefined read percentage, not 0% # If the reads list is empty then no book has a defined value if list_count(reads, ',') == 0 then ans = 'Unread series' fi; for i in reads: # If any book isn't 100 then partially read if i != 100 then ans = 'Partially read series' fi rof; if !ans then ans = 'Read series' fi; vals = list_join(',', vals, ',', series & ':' & ans, ',') rof fi; select(vals, $series) Last edited by chaley; 07-14-2022 at 11:25 AM. Reason: Added the missing call to globals(). Remove blank after 'program' |
|
![]() |
![]() |
![]() |
#419 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
program: # Returns 'Fanfiction/Fandom' for fanfics if $$#fanficcat then list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1') # Returns 'Kobo' for Kobo store books elif '\[Kobo Store\]' in $#kobostatus then 'Kobo Store' # Returns 'PDF' for PDFs elif $formats == 'PDF' then 'PDF' # Returns 'Loans' for Loans elif 'Loans' in $#vls then 'Loans' # Returns topmost tag for all other books else re(sublist($tags, 0, 1, ','), '^(.*?)($|\..*$)', '\1') fi |
![]() |
![]() |
![]() |
#420 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
What do you want to have happen if the first tag is '[Cleanup]'? Do you want the second tag? if so then this would work: Code:
t = sublist($tags, 0, 1, ','); if t == "[CLEANUP]" then t = sublist($tags, 1, 2, ',') fi; re(t, '^(.*?)($|\..*$)', '\1') |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 229 | 08-13-2025 06:41 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 |