Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-21-2013, 05:18 PM   #1
antarex
Junior Member
antarex began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2013
Device: Kindle Paperwhite
Thumbs up Using plugboards to add series only when not already included in the title

Hi,

I like the plugboards and the ability to add series name in front of book name, but i have some books already including the series in the book name in the form "[series-index] Title", resulting when i send them to my kindle with a name like "series - index - [series-index] title", not really what i want...

Could it be possible to create a plugboards rule to add the series and index only when not already present ? To be easiest, it could be a rule to add the series and index only when the title does not begin with [

Any tips to create conditional plugboards rules would be welcome

Thank in advance.

Last edited by antarex; 03-22-2013 at 11:09 AM.
antarex is offline   Reply With Quote
Old 03-21-2013, 08:39 PM   #2
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,737
Karma: 26785684
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Samsung Galaxy Tab S8 Ultra
It is possible to rename the books to remove series information from the titles. It really shouldn't be there in the first place, that is why calibre has separate fields for series information. Then the plugboard will work perfectly as it is.
Adoby is offline   Reply With Quote
Advert
Old 03-22-2013, 03:25 AM   #3
antarex
Junior Member
antarex began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2013
Device: Kindle Paperwhite
Thanks

Of course, but if i ask it's because i would prefer not renaming the existing titles (some books use a personalised/acronym series name in their title, like [SSPP-01] for "Service de Surveillance des planètes primitives-01"). I prefer keeping the whole series name in the corresponding field, but using a mnemotechnic one in the title).
antarex is offline   Reply With Quote
Old 03-22-2013, 05:08 AM   #4
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: 12,318
Karma: 7975240
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
You can do what you want using a general program mode template in the plugboard. One statement would use the contains function to pull out text that indicates that the series is already there, and assign the resulting text to a variable. Another statement would "test" the variable. If it is empty then you generate the text you want. If it is not empty then you pass the title through unchanged (or whatever you want to do). The "template" function would be useful when generating the text.

Something like
Code:
program:
	a=contains(field('title'), '\[', 'XX', '');
	test(a,
		field('title'),
		template('{series:||-}{series_index}{title}'))
Of course you could nest the contains into the test instead of assigning the result to a variable.
chaley is offline   Reply With Quote
Old 03-22-2013, 11:07 AM   #5
antarex
Junior Member
antarex began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2013
Device: Kindle Paperwhite
Thumbs up

Exactly what i was looking for, it's working, thanks a lot !
antarex is offline   Reply With Quote
Advert
Old 04-04-2013, 03:57 PM   #6
maxwelledison
Member
maxwelledison began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jun 2010
Device: Kobo
Anyone know how I can put the series information for my books into the collections field of the Sony Reader? I can see how to put the series name under device config, but not how to get the number of the book in the series along with it. Any help would be appreciated.
Max...
maxwelledison is offline   Reply With Quote
Old 04-05-2013, 01:33 AM   #7
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by maxwelledison View Post
Anyone know how I can put the series information for my books into the collections field of the Sony Reader? I can see how to put the series name under device config, but not how to get the number of the book in the series along with it. Any help would be appreciated.
Max...
You do not want the series number added to the collection name or the Sony will treat them as different Collections. If you want it added anywhere it would be to the title.

I do not bother as when I send the books to my Sony using Calibre they are sent in such a way that books within a collection are displayed on the Sony in the correct series order as specified in Calibre.

However I guess it could be nice to know exactly what number in a series a particular book was as you may not have the complete series on the Sony at a given time.
itimpi is offline   Reply With Quote
Old 04-11-2013, 07:14 PM   #8
ParadiseLost
Enthusiast
ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.
 
Posts: 49
Karma: 20364
Join Date: Mar 2013
Device: None
A little assistance please. Currently I use:

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

to get

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

This also works great for titles with no series. Where i seem to have found a problem is in magazines. Perhaps its not a template issue but an organizational detail i haven't worked out. Dragon magazine is my example. For the Title I use "Dragon 400" and for the Series I use "Dragon Magazine [400]". So what I get with my template is:

[Dragon Magazine 400] - Dragon 400

Any ideas on how to structure my library or alter the template somehow as to not add the {title} if the Series already establishes all the information i need for magazines or vice versa? I've read how others use the date and or volume number. For my purposes I just include the date in the published date field and I'm happy and no other relevant information is needed to distinguish since its only a monthly magazine. Thanks in advance for any assistance.
ParadiseLost is offline   Reply With Quote
Old 04-12-2013, 02:07 AM   #9
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: 12,318
Karma: 7975240
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The template must determine if the "if the Series already establishes all the information I need for magazines". How can it do that? Is there some column or some tag or ??? that can uniquely identify a magazine?
chaley is offline   Reply With Quote
Old 04-12-2013, 12:37 PM   #10
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: 12,318
Karma: 7975240
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ParadiseLost
Im not entirely sure that i understand your Comment. In my issue the Magazine is Dragon Magazine Issue # 400 issued on June 2011. The Fields I use are as follows:

Title: Dragon 400
Author: Wizards of the Coast
Series: Dragon Magazine [400] (auto numbers)
Published Date: June 2011
Publisher: Wizards of the Coast

So i used the Template that worked so great for me in with Series Books and Non series returning the results i posted in the last post.

However with the Magazine I get:

[Dragon Magazine 400] - Dragon 400

If i changed the Title to match the Series is there a way i could alter or append to my original template to check if title and series are the same value and if so not to repeat the information? To arrive at:

Dragon Magazine 400

Yes, i could simply erase the series column but i do use it in sorting. (I think maybe im just being stubborn here -.-)

In either regard thanks for your assistance.
For a template to do what you are asking, calibre must be able to know that the book is a magazine and generate output different from a book. It must be able to determine that fact using only the information in the book's metadata. From what I see, *you* know that it is a magazine but there is nothing in the metadata that tells that to calibre. Perhaps one could do some pattern matching, looking to see if the series number occurs in the title, but this wouldn't be very reliable.

The right way to go is to add some metadata that calibre can use to determine that the book is a magazine. There are several possibilities including:
- Add a specific tag that the template could look for
- Add a yes/no custom column
- Add a "book type" custom column
- Add a custom column that contains the template you want calibre to use. A "column with a fixed set of values" would be good for this.

You would use a send/save template that chooses what to do by using the new metadata. For example, if you did the fourth (column containing the template) and if you gave that column the lookup name #template, then the following template in template program mode would use that value to generate the file name:
Code:
{#template:'template($)'}
For a book you would put the following into the #template column:
Code:
{series:|[|}{series_index:0>2s| |] - }{title}
For a magazine you would put something like the following, perhaps without the brackets
Code:
{series:|[|}{series_index:0>2s| |]}
This is the most general solution, permitting each book or magazine to have a different output template.

A template in general program mode for the yes/no column solution would look something like:
Code:
program:
	test(strcmp(field('#ismagazine'), 'yes', '', '1', ''),
	     template('{series:|[|}{series_index:0>2s| |]}'),
	     template('{series:|[|}{series_index:0>2s| |] - }{title}'))
And so on.
chaley is offline   Reply With Quote
Old 04-12-2013, 12:55 PM   #11
ParadiseLost
Enthusiast
ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.ParadiseLost can self-interpret dreams as they happen.
 
Posts: 49
Karma: 20364
Join Date: Mar 2013
Device: None
Thank you chaley I do use a tag for each type of media. "Type.Magazine." Ill get to work on going that route.
ParadiseLost is offline   Reply With Quote
Old 04-12-2013, 01:22 PM   #12
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: 12,318
Karma: 7975240
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ParadiseLost View Post
Thank you chaley I do use a tag for each type of media. "Type.Magazine." Ill get to work on going that route.
This template should serve as a model.
Code:
program:
	in_list(field('tags'), ',', '^Type.Magazine$',
		template('{series:|[|}{series_index:0>2s| |]}'),
		template('{series:|[|}{series_index:0>2s| |] - }{title}'))
You put all of the above into the template box for save/send. Using the template editor will make that easier.

The ^ and $ around Type.Magazine are there to guarantee that the test matches exactly, not matching something like "A.Type.Magazine.Monthly".

Good luck.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugboard "Metadata: Show series [series index] - title as title (Kindle)" Deep Cover Library Management 6 11-30-2012 05:17 PM
Pubit!/Add Title Previewer shows ellipsis in title bar schooner1892 General Discussions 0 09-15-2012 07:04 PM
emailing books and 'On Device' / series / metadata plugboards affa Library Management 10 06-18-2012 12:45 AM
Add Series information to title? Debby Library Management 1 10-27-2011 03:14 AM
How to add metadata in HTML to have it included when converting to EPUB? richieadler Conversion 2 02-05-2011 10:20 AM


All times are GMT -4. The time now is 02:17 PM.


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