Page 1 of 1

Blank metadata command

Posted: 29 Feb 2020, 09:17
by tyler0887
I wasn't quite sure what to search the forum for in asking this or how to title this post.

This is my syntax for television episodes.

Code: Select all

\Television\{genre}\{n} ({y})\{n} S{s.pad(2)} ({episodelist.findAll{it.season == s}.airdate.year[0,-1].unique().join('-')})\{n} - S{s.pad(2)}E{e.pad(2)} - {t}  ({airdate}) (Dir.{director}) ({runtime}min. {vf} {vc} {af})
My problem is that usually when a piece of metadata is non-existent, in most cases the name of the director, I am simply left with "(Dir.)" in the renamed episode. Is there a way that I can ensure that if the metadata is missing that the renamed episode will rename accordingly? Sorry if this is confusing, I really barely understand most of this, I have only cobbled it together by reading other posts and mashing up the commands I found most appealing. Thanks for any and all help.

Re: Blank metadata command

Posted: 29 Feb 2020, 09:29
by rednoah
You'll want to move the (Dir.) literal into the {expression} so that the expression either yields the String value you want, concatenating prefix/postfix literals and binding value, or yield nothing at all due to the binding failing to evaluate:

Code: Select all

{'(Dir.'+director+')'}

:idea: Here's some general reading on the topic:
viewtopic.php?t=1895