View Single Post
Old 03-08-2015, 01:09 PM   #10
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Thomas_AR View Post
Thanks for all your kind help.

So, i think i nearly have it - nice clear folder structure.

{series:'test($, strcat("_", field('series'), " - ",field('authors')), field('authors'))'}/{series_index:0>4s| | - }{title} - {authors}

But there is one problem in case of series:
If there is only one author everything regarding file structure is perfect, but if i have various authors (i have series with about 10 different authors) i get different folders for the series and the different authors.

series - author 1
series - author 2
etc.

Is there a possibility in case there are various authors for one series to make one folder like:

"Series - Various"

or something similar?
But this is not so important, i can live without the authors string in the series folder name.

Thanks again for your patience.
This would do it.
Code:
{series:'test($, strcat("_", field('series'), " - ", cmp(count(field("authors"), '&'), 2, field('authors'), 'various', 'various')), field('authors'))'}/{series_index:0>4s| | - }{title} - {authors}
However, you have reached the complexity point where I would use general program mode. The template in GPM is something like
Code:
program: 
	s = field('series');
	si=field('series_index');
	a = field('authors');
	t = field('title');
	short_author=cmp(count(a, '&'), 1, a, a, 'various');
	strcat(
		test(s, strcat("_", s, " - ", short_author), a),
	 	'/',
		finish_formatting(si, '0>4s', '', ' - '),
		t,
		' - ',
		a)

Last edited by chaley; 03-08-2015 at 01:12 PM.
chaley is offline   Reply With Quote