View Single Post
Old 01-01-2024, 06:01 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,511
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I am not sure what your first template is trying to do. It appears to be trying to extract the first character of the series, then the first 2 characters, then the third and fourth characters, then other stuff.

If the above is correct then this general progrm mode template does the job.
Code:
program:
	if $series then
		template('series/{series:substr(0,1)}/{series:substr(0,2)}/{series:substr(2,4)}/{series_index:0>3s} - {title}/{author_sort:sublist(0,1,&)} - {series} - {series_index:0>3s} - {title}')
	else
		template('single books/{author_sort[0]}/{author_sort:sublist(0,1,&)}/{title}/{author_sort} - {title}')
	fi
chaley is offline   Reply With Quote