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 08-06-2011, 08:36 AM   #1
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
Adding author name to series name

I use the plugin that creates Kindle collections based on the series name.

I have all my Series names done correctly in Calibre, for example "Millennium Trilogy".

When I create the collection, or even at any stage, I want to append the author name in brackets to the start of the series, e.g. "(Steig Larsson) Millennium Trilogy"

I guess I could do it manually, maybe using "Search & Replace" in the Edit Metadata screen, but is there a quicker/auto way of doing it?
gers1978 is offline   Reply With Quote
Old 08-06-2011, 08:53 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,890
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by gers1978 View Post
When I create the collection, or even at any stage, I want to append the author name in brackets to the start of the series, e.g. "(Steig Larsson) Millennium Trilogy"
Read this sticky post on plugboards.
DoctorOhh is offline   Reply With Quote
Advert
Old 08-06-2011, 09:58 AM   #3
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
Thanks. Got it. Here's how I did it:

1) Create a new custom column called "Collection"
2) Set it to "Column built from other columns"
3) Set the Template field to "{series:|({author}) |}"
4) Set the "Kindle Collections" plugin to create collections using my "Collection" column

Line 3 above is used so that if the book has no "Series", the new "Collection" stays blank, and if the book has a "Series" the "Collection" column is set to "(author name) series".

For example, if I have a book called "Tom Clancy - Dead or Alive" and the series is set to "Jack Ryan", the new "Collection" column will read:

(Tom Clancy) Jack Ryan
gers1978 is offline   Reply With Quote
Old 08-06-2011, 12:24 PM   #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,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by gers1978 View Post
3) Set the Template field to "{series:|({author}) |}"
Using template items inside template items can lead to very strange results. The fact that it works at all is a bug that I haven't fixed because it can be useful in the right context. The problem is that the value of the subitem will be rescanned in the context of the containing item as if it had been hand-typed there. Special characters such as | and {} and : inside the subitem will greatly confuse the scanning of the containing item.

If you can guarantee that the subitem ({authors} in this case) will never contain any of the characters { } | and possibly " and ', then there is no problem.

The following template avoids this problem by using template program mode instead of a sub-item.
Code:
{series:'test($, strcat('(', field('authors'), ') ', $), '')'}
If series has a value, then return the desired string built by concatenating together the parts, otherwise return the empty string.
chaley is offline   Reply With Quote
Old 08-06-2011, 12:49 PM   #5
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
That's great, thanks. Could you explain exactly why your's is different to mine? Cheers.

I've spotted a problem with both your method and mine; namely, if a book in a series 2 authors, the series name will also show 2 authors (but I don't want it to).

For example, say I have a series called "Romantic Saga" by Linda Smith, let's say 3 books. If book number 2, for example, is authored by "Linda Smith & Paul Jones", I end up with the new "Collection" column showing:

(Linda Smith) Romantic Saga
(Linda Smith & Paul Jones) Romantic Saga
(Linda Smith) Romantic Saga

Anyway round this? I'd like for the series bit just to use the 1st author name.

Last edited by gers1978; 08-06-2011 at 12:53 PM.
gers1978 is offline   Reply With Quote
Advert
Old 08-06-2011, 12:59 PM   #6
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,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by gers1978 View Post
That's great, thanks. Could you explain exactly why your's is different to mine? Cheers.
It doesn't have the subitem problem that I described in my post, because there are no subitems.

As for using one author, try
Code:
{series:'test($, strcat('(', list_item(field('authors'), 0, ' & '), ') ', $), '')'}

Last edited by chaley; 08-06-2011 at 01:02 PM. Reason: I answered only half the question
chaley is offline   Reply With Quote
Old 08-06-2011, 01:11 PM   #7
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by chaley View Post
It doesn't have the subitem problem that I described in my post, because there are no subitems.
What's a subitem?

Quote:
As for using one author, try
Code:
{series:'test($, strcat('(', list_item(field('authors'), 0, ' & '), ') ', $), '')'}
Will try it, thanks
gers1978 is offline   Reply With Quote
Old 08-06-2011, 01:23 PM   #8
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
{series:'test($, strcat('(', list_item(field('authors'), 0, ' & '), ') ', $), '')'}

seems to work great, thanks. Are there any little subtleties that might trip it up?
gers1978 is offline   Reply With Quote
Old 08-06-2011, 01:29 PM   #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,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by gers1978 View Post
What's a subitem?
In this discussion, a template item is something enclosed in { } characters. A subitem is something inside an item, also enclosed in { } characters. I have highlighted the subitem in your template in bold.

{series:|({author}) |}

Regarding subtleties, things might get strange if your series or author metadata contains slashes and you use the template in the context of a file path, but this isn't a template issue.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding books with series in the filename genright Library Management 5 06-13-2011 03:20 PM
Get to Know-an Author with Noahan Author Interview series! NoahMGillman Self-Promotions by Authors and Publishers 22 12-19-2010 09:45 PM
Adding book series to cover??? artemisblossom Calibre 4 09-14-2010 05:31 PM
Adding Series and Number to Title. Cerepol Calibre 17 09-01-2010 06:50 PM
Author, Series, Series #, Books diokdin Calibre 19 05-14-2010 05:36 AM


All times are GMT -4. The time now is 03:34 PM.


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