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 09-23-2018, 05:01 AM   #16
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
Tanjamuse provide me an example library where I did some tests. In order to tie up my loose ends in this thread, here is the solution that fits to her needs.

Code:
program: 

tmp1 = template('{#fandoms:sublist(0,2,&)}{#fandom_secondary:sublist(0,2,\,)}/{author}/{title} ({#story_id})');
tmp2 = template('Crossovers/{#fandoms:sublist(0,2,&)}{#fandom_secondary:sublist(0,2,&)}/{author}/{title} ({#story_id})');
tmp3 = template('Multiple Crossovers/{author}/{title} ({#story_id})');
    cmp(
        count(
            field('#fandoms'), 
            ','), 
        2, 
        re(re(tmp1,': ','_'),',',' - '), 
        re(re(tmp2,': ','_'),',',' - '), 
        tmp3)
Divingduck is offline   Reply With Quote
Old 03-16-2019, 12:14 PM   #17
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
How do I make sure that the output is sorted alphabetically?

Example:

Angel The Series, Buffy The Vampire Slayer, Queer Eye for the Straight Guy

becomes

Buffy The Vampire Slayer & Queer Eye for the Straight Guy & Angel The Series

Even if I change the & to commas it still doesn't sort them alphabetically.

This is the template I'm using.

Code:
"program: tmp1 = template('{#parent_fandom}/{#meta_fandom:sublist(0,2,&)}{#fandom_secondary:sublist(0,2,\\,)}/{#story_id}/{author} - {title}'); tmp2 = template('{#parent_fandom}/{#meta_fandom:sublist(0,2,&)}{#fandom_secondary:sublist(0,2,&)}/{#story_id}/{author} - {title}'); tmp3 = template('_ Multiple Crossovers/{#story_id}/{author} - {title}'); cmp(count(field('#meta_fandom'), ','), 2, re(re(tmp1,': ',' '),',',' & '), re(re(tmp2,': ',' '),',',' & '), tmp3)"
I know tmp1 and 2 are the same but I can't figure out how to remove it and still getting the template to work.
Tanjamuse is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving ebooks problems Tanjamuse Calibre 12 07-15-2018 08:37 PM
Help with a 'Saving Books to Disk' Template Vortex Calibre 5 12-04-2014 09:18 AM
help with saving template having multiple authors? miquele Library Management 2 04-16-2013 04:49 PM
Save template problem antoon Library Management 12 08-17-2012 12:47 PM
Saving to Disk Template hurricane51 Conversion 2 07-07-2011 01:22 AM


All times are GMT -4. The time now is 10:09 AM.


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