![]() |
#391 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 896
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
|
![]() |
![]() |
![]() |
#392 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
|
![]() |
![]() |
Advert | |
|
![]() |
#393 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 896
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
First I thought of title, but now I'm going to use it with author.
The authors column has three possibilities. The first is that you only have a last name, like Aristotle or Anonymous, for example. In this case I add a comma and a hyphen at the end of the name. Aristotle,- The second consists of a first name and a last name. If I jointly select all the authors of this type, I can transform them jointly, which is what I want. I can transform all these authors directly into APE, NOM through the PlugIn QualityCheck The third option would imply either two names and a surname, which would select and transform them in the same way, or one or two names and two surnames, in which case I would change them manually one by one, managing Authors, as before. As you can see, I am only looking for a way to simplify the process of incorporating the periodic updates of the •LIBRARY ————— With the column I'm looking to implement, I'd get a 1 for the second case. Then I would sort it, and select all the ones that had 1. I hope I have explained myself well |
![]() |
![]() |
![]() |
#394 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: How would I check whether the values of identifier: and identifier2: (in this case, mobi-asin: and amazon: ) are identical?
|
![]() |
![]() |
![]() |
#395 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
Advert | |
|
![]() |
#396 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thanks
![]() |
![]() |
![]() |
![]() |
#397 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question:
Code:
program: ids = $identifiers; mobi = select(ids, 'mobi-asin'); amazon = select(ids, 'amazon'); if mobi && !amazon then n = re(mobi, '(.*)', '\1'); ids = list_union(ids, strcat('amazon:', n), ',') else ids fi; if mobi == amazon then ids = list_difference(ids, strcat('mobi-asin:', mobi), ',') else ids fi The results are this: Aside from either separating the two parts into separate templates or running it twice, is there any way to tell it "do part A (copy mobi-asin to amazon), and then also do part B (remove mobi-asin)"? EDIT: See my post in the while loop thread. ![]() Last edited by ownedbycats; 05-10-2022 at 03:12 AM. |
![]() |
![]() |
![]() |
#398 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Aside: what is the "n = re(mobi, '(.*)', '\1');" for? That (almost) copies mobo to n. Except there will be problems with the .*, which can copy the empty string. Why not just use 'mobi' in the list_union()? |
|
![]() |
![]() |
![]() |
#399 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Lines 6-13: If there's no amazon identifier, copy the contents of mobi-asin to it.
Lines 16-22: If mobi-asin and amazon are identical, remove mobi-asin. As it currently is, if there's only mobi-asin, it will copy it to amazon but then not remove it afterwards, and I need to run it a second time. I think one of the ids in the second section is checking the original state of the column and not the updated one. Last edited by ownedbycats; 05-10-2022 at 04:55 AM. |
![]() |
![]() |
![]() |
#400 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
![]() Code:
program: ids = $identifiers; mobi = select(ids, 'mobi-asin'); amazon = select(ids, 'amazon'); if mobi && !amazon then n = re(mobi, '(.*)', '\1'); ids = list_union(ids, strcat('amazon:', n), ',') else ids fi; mobi = select(ids, 'mobi-asin'); amazon = select(ids, 'amazon'); if mobi == amazon then ids = list_difference(ids, strcat('mobi-asin:', mobi), ',') else ids fi Last edited by ownedbycats; 05-10-2022 at 04:59 AM. |
|
![]() |
![]() |
![]() |
#401 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
amazon = mobi |
|
![]() |
![]() |
![]() |
#402 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thanks
![]() Question: When exactly does a stored template re-calc? Example: Suppose I have a stored template that I use in an action chain to modify a column. Does it only calculate when I run the chain? |
![]() |
![]() |
![]() |
#403 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I assume "calculate" means "run". It runs when it is used no matter the context. In an action chains context it will be the chain template that calls the stored template.
|
![]() |
![]() |
![]() |
#404 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: May 2022
Device: Kindle Paperwhite 5
|
Is there a way to change the template based on the format of the book being sent?"
I send both .epub and .cbz to my device and prefer different naming schemes for them. With .epub, I like books/{author_sort}/{series}/{title} But with .cbz, I want books/{author_sort}/{series}/{title} (being comics, each chapter/volume is already named {series}{series_index}) Currently, I either have to manually edit the template each time I switch formats (which also requires restarting Calibre and remounting the folder), or I have to switch how the device is mounted (Connect to Folder for .cbz and Wireless Connection for .epub) There's got to be an easier way though, right? |
![]() |
![]() |
![]() |
#405 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I may be wrong on this, I don't believe variations can be done with a basic template.
I have a similar case, and what I did was create a composite column and use a GPM template. Try working off this -- I'm a bit foggy on how to do the 'stuff here' though ![]() Code:
program: if 'cbz' in approximate_formats() then '(some stuff here)' else '(other stuff here)' fi For reference, here's my templates: Code:
program: # Returns 'Fanfiction/Fandom' for fanfics if $$#fanficcat then list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1') # Returns 'Kobo' for Kobo store books (in the rare case I need to sideload one) elif '\[Kobo Store\]' in $#kobostatus then 'Kobo Store' # Returns 'PDF' if PDF is only format 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 Code:
{#kobopath}/{author_sort:sublist(0,1,&)}/{title} - {authors} Last edited by ownedbycats; 05-25-2022 at 05:04 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 225 | 08-04-2025 06:31 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 |