Page 1 of 1

Brackets filled if any fields populate

Posted: 26 Apr 2020, 03:25
by ketterer
Hello,
I thought I understood this better, but it seems like i don't I want to rename files Moviename (year) [videoinfo] [audioinfo] [release}
but i want multiple pieces of data to appeear in each of the square brackets. I only want the square brackets to appear if they are populated, BUT i want each field to populate if its availeable, or show nothing,
I treid this

Code: Select all

Movies/{n} ({y})/{n} ({y}) {tags} {"[ ${vs}-${vf} ${hd} ${vc}]"} {"[${ac} ${channels}]"} {"[$group]"} {' CD'+pi}{subt}{fn.match(/-fanart/)}{fn.match(/-poster/)}
the biggest problem i have currently is that the brackets dont appear if any of the fields are not populated. Is there a way to make it still output even if some fields within the brackets dont get populated. I want it to do an or operation rather then and.
is there a way do this,

Re: Brackets filled if any fields populate

Posted: 26 Apr 2020, 03:27
by ketterer
Just to clarify, I want the brackets to be displayed as long as any 1 of the fields in the bracket is populated, and not who brackets if all feilds are empty

Re: Brackets filled if any fields populate

Posted: 26 Apr 2020, 06:13
by rednoah
e.g.

Code: Select all

{allOf{ac}{channels}.joining(' ', '[', ']')}

Re: Brackets filled if any fields populate

Posted: 26 Apr 2020, 09:01
by ketterer
thanks Rednoah

Tonight a really great user anoxmous really helped me and he was able to write this. I think I understand the basic syntax, and will hopefully be able to learn from it

Code: Select all

/mnt/Multimedia/Movies/{kodi.derive{' '+tags}{' ['+allOf{any{vs+'-'+vf}{vf}}{vc.replace('AVC':'x264','HEVC':'x265')+']'}{'['+ac+' '+{channels}+{'] ['+group}}.join(' ')+']'}.tail}