11-27-2014, 11:26 PM | #616 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
You can probably use {series:ifempty(noseries)| - | } to replace the series info with "noseries". Although that might not be the height of elegance, it would presumably get the authors to be shown as LN, FN.
|
11-28-2014, 04:46 PM | #617 | |
Connoisseur
Posts: 78
Karma: 65054
Join Date: Oct 2014
Location: Germany
Device: Sony PRS-T2, Kindle PW2, Oasis 3
|
Quote:
Atm, my plug is: Code:
{author_sort:||,}{series:| - | }{series_index:0>3s} Code:
{author_sort:||,}{series:| - | }{series_index:0>3s}{tags:uppercase()| |} Sebastian Junger it would then show Junger, Sebastian, CONTEMPORARY, CREATIVE NONFICTION Or, if the book was in a series: Junger, Sebastian, - Andrea Gail 001 CONTEMPORARY, CREATIVE NONFICTION Sorting should then be either: author_sort, tags or: author_sort, series, series_index, tags depending on the book being in a series or not. I'd love to see my genre info there or at least, if the series title is overly long, the first part of the genre(s) For everybody who would like to try it out but would like to see something less bulky in the author line: {languages} or {pubdate} would be short and still helpful for some. "noseries" would be nice to have if one is unsure whether the series thing is really working or not. To see if there would still be books showing neither series information nor "noseries"... All that given that I'm thinking right here hehe, will test it when I have the time. |
|
Advert | |
|
11-29-2014, 09:04 PM | #618 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
You can also make it conditional on whether or not the series is there.
http://manual.calibre-ebook.com/temp...l-program-mode But it is still dependent on having tags or series. Code:
program: series_formatted = strcat( finish_formatting( field('series'), '', '', '' ), finish_formatting( field('series_index'), '0>3s', ' ', '' ) ); # Main strcat( field('author_sort'), finish_formatting( ifempty( series_formatted, uppercase(field('tags')) ), '', ', - ', '' ) ) Or, if the book was in a series: Junger, Sebastian, - Andrea Gail 001 Or if there is no tags OR series: Sebastian Junger Last edited by eschwartz; 11-29-2014 at 09:25 PM. |
12-11-2014, 11:45 PM | #619 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Dec 2008
Device: iPad Air, Kobo Aura H2O
|
I'm hoping someone can help me with a composite column. I have a Kobo Aura H2O and I'm using KoboUtilities to create a Reading Status column (thanks to PeterT's recipe) that marks a book as finished when it is 100% read.
I would like to create a column that looks at one column to see if a book is new (currently I've created a Yes/No custom column for this, but I could change that if necessary), then it looks to see if the book is finished. If the book is new and not finished, it assigns a value "1-New" to the column. If it isn't new or is new but finished, it assigns no value to the column. I can then use this column to define one of the "Shelves" on my Kobo and it will automatically update my to read pile to remove books I've finished. I know very little about programming, but I can usually use someone else's "recipe" to do what I want, even if I have to change it a little. I've managed to create a column that can look at the #new column OR the #readingstatus column, but I can't seem to create one that will look at both. Can anyone help? |
12-12-2014, 01:33 AM | #620 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Well, assuming they are both yesno type columns:
Code:
program: test( and( field('#new'), not( field('#readingstatus') ) ), '1-New', '' ) Last edited by eschwartz; 12-12-2014 at 01:57 PM. Reason: template typo |
Advert | |
|
12-12-2014, 11:24 AM | #621 | |
Enthusiast
Posts: 30
Karma: 10
Join Date: Dec 2008
Device: iPad Air, Kobo Aura H2O
|
Quote:
This works (other than one missing closed parenthesis, but that was easy to fix)! My #readingstatus column is not Yes/No but I created another custom column from the #readingstatus column that was Yes/No and it works great! Thanks for the quick reply! Just out of curiosity, how would you use the and/not or something similar with a function that is testing against a pattern instead of just looking for empy/not empty? I had actually tried using GPM instead of TPM, but I couldn't get any type of and/not or and/or to work with the contains function. Last edited by matanic; 12-12-2014 at 11:32 AM. Reason: added another question |
|
12-12-2014, 11:50 AM | #622 | |
Grand Sorcerer
Posts: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: test( and( field('#mybool'), contains(field('#mytextmult'), 'watson', '1', '') ), '1-New', '') |
|
12-12-2014, 12:51 PM | #623 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Dec 2008
Device: iPad Air, Kobo Aura H2O
|
Thanks chaley! I'll try it out tonight when I get home and see what I can do with it.
|
12-12-2014, 02:01 PM | #624 | ||
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
Quote:
Contains can be used to return "1" or the null value "" depending on the match, and the and() and not() functions are booleans that check for non-empty strings. So, we can cut down on the number of custom columns by using: Code:
program: test( and( field('#new'), contains(field('#readingstatus'), '100%_I_am_done_yay', '', '1-New') ), '1-New', '' ) Last edited by eschwartz; 12-13-2014 at 09:45 PM. Reason: chaley's correction |
||
12-12-2014, 10:30 PM | #625 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Dec 2008
Device: iPad Air, Kobo Aura H2O
|
Thank you, eschwartz! That works perfectly and I think I understand enough to be able to use it for other things. My reading status just says Finished but yours is definitely more interesting! Thanks to you and chaley for all the help, you were both quick to respond and patient with my questions.
|
12-13-2014, 04:17 AM | #626 |
Grand Sorcerer
Posts: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@eschwartz: I would forget the not() wrapping the contains(), instead inverting the order of contain()'s returned values. Better performance and (for me at least) easier to read.
|
12-13-2014, 09:34 PM | #627 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Probably, but my mind was on the previous syntax when I fired that off. Thanks for the reminder.
|
02-01-2015, 04:14 PM | #628 |
Member
Posts: 18
Karma: 10
Join Date: Aug 2010
Location: Florida
Device: Samsung Galaxy Tab A 8" (2017)
|
author_sort w/o comma
In Send to Device, Ectaco Jetbook Lite requires the following format in the filename for anything but TXT files (It doesn't sort by metadata, only the filename by either Author (lastname fistname) or Title:
LN(space, no comma)FN_Title i.e. Twain Mark_Adventures of Huckleberry Finn I need to do folders on the device by Genre(3 levels)/[Series if present/]LN(space)FN_Title[(space)(Series_number if present)] I currently use {#genre:subitems(0,1)||/}{#genre:subitems(1,2)||/}{#genre:subitems(2,3)||/}{series:||/}{author_sort:sublist(0,1, &)}_{title:sublist(0,1,|| (}{series_index:>4.2f||)} Everything works plugged into the Jetbook device template BUT the author_sort leaves a comma in the filename which screws up the Jetbook's sort. I have no troubles with my other devices, just saving to the Jetbook. I currently use a file-renamer after the save to remove the comma but that's an extra step I'd like to skip. |
02-01-2015, 04:43 PM | #629 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Code:
{author_sort:'re(sublist($, 0, 1, '&'), ',', '')'} Code:
#enter template program mode {author_sort:' #regex re( #Find the first author_sort sublist($, 0, 1, "&"), #and replace the comma ",", #with nothing "" ) '} Last edited by eschwartz; 02-01-2015 at 04:45 PM. |
02-01-2015, 05:48 PM | #630 |
Member
Posts: 18
Karma: 10
Join Date: Aug 2010
Location: Florida
Device: Samsung Galaxy Tab A 8" (2017)
|
Thanks, I'll try it when I get back home.
|
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 |