Just for fun, I wrote the custom template function to do this job.
Code:
Function name: myListMerge (or whatever you want)
Argument count: 5
Program code:
def evaluate(self, formatter, kwargs, mi, locals, tags, shelf, genre, length, character):
r = set([t.strip() for t in tags.split(',') if t.strip()])
r |= set([t.strip() for t in shelf.split(',') if t.strip()])
r -= set([t.strip() for t in genre.split(',') if t.strip()])
r -= set([t.strip() for t in length.split(',') if t.strip()])
r -= set([t.strip() for t in character.split(',') if t.strip()])
return ', '.join(sorted(r))
You would use it like
Code:
{:'myListMerge(field('tags'), field('#shelf'), field('#genre'), field('#length'), field('#character'))'}
In fact, I don't suggest that you use it unless you understand it, otherwise you won't be able to maintain it. I did it because I was curious.