View Single Post
Old 04-05-2023, 10:11 AM   #1
slb
Junior Member
slb began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
Make composite column series_sort

I'll start with saying I have no programming background. And this is the first time I'm trying something like this in Calibre. First time posting here also.

I have several series with the same name. I want to have them sorted so they are directly behind eachother. But I want each language seperate.

I want to sort like this: series_sort -> language -> series_index

ex.: Talon by Julie Kagawa

What I want:

Talon [1] - Talon - Julie Kagawa - English
Talon [2] - Rogue - Julie Kagawa - English
...
Talon [1] - Pupil - Julie Kagawa - Dutch
Talon [2] - Rebel - Julie Kagawa - Dutch
...

What I get is:

Talon [1] - Talon - Julie Kagawa - English
Talon [1] - Pupil - Julie Kagawa - Dutch
Talon [2] - Rogue - Julie Kagawa - English
Talon [2] - Rebel - Julie Kagawa - Dutch
...
(Because when you sort, you only have the option series. You sort then by series_sort as well as series_index. You don't have the option to sort by series_sort.

I can make a new column series, but then it doesn't take the artikels into account, which is super annoying.

So to fix this I want to make a composite column series_sort. However I keep running into problems.

I have tried entering:
series_sort
series_sort()
{series_sort}
{series_sort()}

Please help!!

If you help, please do it step by step. Where I need to go, where I need to type in the data, best if I can do copy/paste. Because otherwise I have no idea or experience with templates and stuff.

I received this from one of the creators but I have absolutely no idea where I need to imput this. What I need to do.

program:
sort = series_sort();
lang = finish_formatting(language_strings($language, 1), '', ' - ', '');
if sort then
strcat(series_sort() & lang & ' - [' & $series_index & ']')
else
'No series'
fi

Thank you
slb is offline   Reply With Quote