Quote:
Originally Posted by imnnrv
My non-fiction collection consist mostly of 1-2 books of each author and i would like export these books into one directory, except rare cases when i have many books of this author.
Is there any way to make export template which creates directory .../category/author for author only if there are more than X books of this author? If there less than X his books, then put them into .../category/
|
You don't say what "category" is or what to do with multiple authors. I used 'tags' for category, which is probably wrong.
Customize this template to give the answer you want. I used the 'template()' function because that might be easier for you. If I was doing this for me then I would construct the results myself.
Code:
program:
first_author = list_item($authors, 0, '&');
books_by_author = book_count('authors:"""=' & first_author & '"""', 0);
X = 2;
if books_by_author < X then
answer = template('{tags}')
else
answer = template('{tags}/{authors:list_item(0,&)}')
fi;
answer