Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 11-27-2014, 11:26 PM   #616
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Old 11-28-2014, 04:46 PM   #617
PRS-T2
Connoisseur
PRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileReadPRS-T2 has read every ebook posted at MobileRead
 
PRS-T2's Avatar
 
Posts: 78
Karma: 65054
Join Date: Oct 2014
Location: Germany
Device: Sony PRS-T2, Kindle PW2, Oasis 3
Quote:
Originally Posted by eschwartz View Post
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.
Yes I also thought about something like that. Was torn between either indicating that the book is not in a series, just like you're suggesting, or putting some valuable information behind it.

Atm, my plug is:
Code:
{author_sort:||,}{series:| - | }{series_index:0>3s}
And I think I'll make it
Code:
{author_sort:||,}{series:| - | }{series_index:0>3s}{tags:uppercase()| |}
Instead of:
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.
PRS-T2 is offline   Reply With Quote
Advert
Old 11-29-2014, 09:04 PM   #618
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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'))
		),
		'',
		', - ',
		''
	)
)
Junger, Sebastian, - CONTEMPORARY, CREATIVE NONFICTION

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.
eschwartz is offline   Reply With Quote
Old 12-11-2014, 11:45 PM   #619
matanic
Enthusiast
matanic began at the beginning.
 
matanic's Avatar
 
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?
matanic is offline   Reply With Quote
Old 12-12-2014, 01:33 AM   #620
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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
eschwartz is offline   Reply With Quote
Advert
Old 12-12-2014, 11:24 AM   #621
matanic
Enthusiast
matanic began at the beginning.
 
matanic's Avatar
 
Posts: 30
Karma: 10
Join Date: Dec 2008
Device: iPad Air, Kobo Aura H2O
Quote:
Originally Posted by eschwartz View Post
Well, assuming they are both yesno type columns:

Code:
program:

test(
    and(
        field('#new',
        not(
            field('#readingstatus')
        )
    ),
    '1-New',
    ''
)

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
matanic is offline   Reply With Quote
Old 12-12-2014, 11:50 AM   #622
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by matanic View Post
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.
Here is an example from my play library, using my column names. #mytextmult is a "text, like tags" column.
Code:
program:

test(
    and(
        field('#mybool'),
        contains(field('#mytextmult'), 'watson', '1', '')
    ), '1-New',  '')
chaley is offline   Reply With Quote
Old 12-12-2014, 12:51 PM   #623
matanic
Enthusiast
matanic began at the beginning.
 
matanic's Avatar
 
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.
matanic is offline   Reply With Quote
Old 12-12-2014, 02:01 PM   #624
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
Originally Posted by matanic View Post
This works (other than one missing closed parenthesis, but that was easy to fix)!
Huh, how about that. (Fixed for posterity.)

Quote:
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.
As chaley said.

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',
    ''
)
Or whatever is in your #readingstatus column.

Last edited by eschwartz; 12-13-2014 at 09:45 PM. Reason: chaley's correction
eschwartz is offline   Reply With Quote
Old 12-12-2014, 10:30 PM   #625
matanic
Enthusiast
matanic began at the beginning.
 
matanic's Avatar
 
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.
matanic is offline   Reply With Quote
Old 12-13-2014, 04:17 AM   #626
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
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.
chaley is offline   Reply With Quote
Old 12-13-2014, 09:34 PM   #627
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
Originally Posted by chaley View Post
@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.
Probably, but my mind was on the previous syntax when I fired that off. Thanks for the reminder.
eschwartz is offline   Reply With Quote
Old 02-01-2015, 04:14 PM   #628
captpete
Member
captpete began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2010
Location: Florida
Device: Samsung Galaxy Tab A 8" (2017)
Question 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.
captpete is offline   Reply With Quote
Old 02-01-2015, 04:43 PM   #629
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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, '&'), ',', '')'}
Broken down:
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.
eschwartz is offline   Reply With Quote
Old 02-01-2015, 05:48 PM   #630
captpete
Member
captpete began at the beginning.
 
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.
captpete is offline   Reply With Quote
Reply

Tags
custom column, tag, tags

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 08:57 PM.


MobileRead.com is a privately owned, operated and funded community.