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

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: 395
Karma: 24165
Join Date: Jun 2010
Device: Kindle 3
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
Wizard
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: 2,830
Karma: 4193095
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
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
 
Enthusiast
Old 01-11-2011, 03:49 AM   #3
chaley
"chaley", not "charley"
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: 5,626
Karma: 857074
Join Date: Jan 2010
Location: France
Device: Many android devices
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: 395
Karma: 24165
Join Date: Jun 2010
Device: Kindle 3
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:17 AM.


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