![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#2 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,890
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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'), ') ', $), '')'} |
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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 |
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
|
|
![]() |
![]() |
![]() |
#8 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |