View Single Post
Old 09-17-2018, 07:12 AM   #15
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
I'll try to be more specific:

I would like them sorted like this:

3 or more fandoms in Multiple Crossovers

only 2 fandoms in Crossovers

The one below only creates the Crossover and no longer the Multiple Crossovers, instead it creates a folder with only the first 2 fandoms in the long list from the multiple crossovers.

Code:
program: 
tmp0 = template('No Crossovers/{author}/{title} ({#story_id})');
tmp1 = template('{#fandom_main:sublist(0,2,\,)}{#fandom_secondary:sublist(0,2,\,)}/{author}/{title} ({#story_id})');
tmp2 = template('Crossovers/{#fandom_main:sublist(0,2,\,)}{#fandom_secondary:sublist(0,2,\,)}/{author}/{title} ({#story_id})');
tmp3 = template('Multiple Crossovers/{author}/{title} ({#story_id})');

## old version check if count is lt, eq,gr
#	cmp(
#		count(
#			field('#fandom_main'), 
#			','), 
#		3, 
#		tmp1, 
#		tmp2, 
#		tmp2);

## new version as "case of count =x"
switch(
		count(field('#fandom_main'), ','),
				0, tmp0,
				1, tmp1,
				2, tmp2,
				3, tmp3,
				tmp3);
I need help for another version of the template as well.

Last edited by Tanjamuse; 09-17-2018 at 02:43 PM.
Tanjamuse is offline   Reply With Quote