![]() |
#1 | |
Enthusiast
![]() Posts: 33
Karma: 10
Join Date: Jan 2012
Location: Texas, USA
Device: Kindle Paperwhite 4
|
Help with series_sort()
I am trying to create a custom column that combines the series info with the title info in Calibre. What I currently have that column define as is
Code:
{series}{series_index:0>2s| [|]: }{title_sort} Code:
{series:series_sort()}{series_index:0>2s| [|]: }{title_sort} Quote:
Calibre version 0.8.46, Windows XP SP3 Edit: Also, is this the right board for this question or should I have posted somewhere else? Last edited by razorsoup; 04-10-2012 at 10:49 AM. Reason: Question about board |
|
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,336
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The series_sort function can be used only in template program mode or general program mode. You are using single function mode.
In TPM you would use Code:
{:'series_sort()'}{series_index:0>2s| [|]: }{title_sort} Code:
program: strcat(series_sort(), finish_formatting(field('series_index'), '0>2s', ' [', ']: '), field('title')) Code:
program: strcat(series_sort(), finish_formatting(field('series_index'), '05.2f', ' [', ']: '), field('title')) |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 33
Karma: 10
Join Date: Jan 2012
Location: Texas, USA
Device: Kindle Paperwhite 4
|
I used
Code:
program: strcat(series_sort(), finish_formatting(field('series_index'), '0>2s', ' [', ']: '), field('title_sort')) ![]() |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,336
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
GPM templates will usually have much better performance when they are used in custom columns. Calibre compiles them to python and runs them as part of calibre itself, so the templates run between 20 and 50 times faster than the equivalent TPM template. On the other hand, compilation takes some about of time, which for small libraries may exceed the template's total running time. But for small libraries template running time doesn't really matter, so this shouldn't be an issue. |
|
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() Posts: 33
Karma: 10
Join Date: Jan 2012
Location: Texas, USA
Device: Kindle Paperwhite 4
|
So generally, GPM=More flexibilty and faster execution but more difficult to write while TPM=Slower execution but easier to write.
Awesome. Thanks for the help. |
![]() |
![]() |
Advert | |
|
![]() |
Tags |
calibre 8.46, custom column, error message, series sort |
|