Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-10-2011, 08:36 PM   #1
gweminence
Fat Guy
gweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notes
 
Posts: 408
Karma: 24165
Join Date: Jun 2010
Device: Kindle Voyage
Plugboard Question

So I modified one of the plugboard suggestions (from the sticky) slightly, so that the title of the book goes first, followed by a delineating character, followed by series info. Here's the plugboard formula:

{title} | {series:|| }{series_index:0>2s|[|]}

Here's sample output:

A Game of Thrones | A Song of Ice and Fire [01]

This is great (Thanks to everyone involved!), except for one little thing: when sending a single book (ie, not part of a series), I get this:

Book Title |


My question is, is there a method to make that delineating character conditional upon there actually being a series in the metadata? If so, pointers would be greatly appreciated.
gweminence is offline   Reply With Quote
Old 01-10-2011, 09:24 PM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
You need to bring the delineated char inside the {series} part so that it only appears when {series} is not empty.

If you could live with using a dash rather than a vertical bar as the delineating char this would work:
Code:
{title}{series:| - | }{series_index:0>2s|[|]}
i.e. you'd get

A Game of Thrones - A Song of Ice and Fire [01]

This is because the vertical bar has a special meaning in the template language. There may be a way to get exactly what you want but I'm not sure how.
jackie_w is offline   Reply With Quote
Advert
Old 01-11-2011, 03:49 AM   #3
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,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by jackie_w View Post
This is because the vertical bar has a special meaning in the template language. There may be a way to get exactly what you want but I'm not sure how.
You cannot get around the | issue in single-function mode (the default). You can do it in either template program mode or general program mode.

In template program mode, use:
Code:
{title}{series:'test($, ' | ','')'}{series} {series_index:0>2s|[|]}
In general program mode, use:
Code:
program: 
	strcat(	field('title'), 
			test(field('series'), ' | ', ''), 
			template('{series} {series_index:0>2s|[|]}')
	)
chaley is offline   Reply With Quote
Old 01-11-2011, 01:34 PM   #4
gweminence
Fat Guy
gweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notesgweminence can name that song in three notes
 
Posts: 408
Karma: 24165
Join Date: Jun 2010
Device: Kindle Voyage
Jackie, thanks for taking the time to help me.

Chaley, I went with your template program mode version, which, of course, worked perfectly. Thanks a ton for taking the time to write that for me.
gweminence is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
metadata plugboard functions? mfaine Calibre 2 01-09-2011 05:37 AM
K3 plugboard basics jackie999 Calibre 13 12-13-2010 03:48 AM
Metadata Plugboard - First Char of each word in Series MikeP1212 Calibre 2 10-14-2010 06:14 PM
PRS-505 Getting Authors to sort by last name using Calibre's metadata plugboard. ligelowbee Sony Reader 5 10-14-2010 12:06 PM
Problem with Metadata Plugboard cheveguerra Calibre 3 10-05-2010 12:00 PM


All times are GMT -4. The time now is 06:32 PM.


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