Binding for destination folder?

All about user-defined episode / movie / file name format expressions
Post Reply
Tweak_four17
Donor
Posts: 53
Joined: 24 Apr 2014, 19:30

Binding for destination folder?

Post by Tweak_four17 »

Is there a binding for the destination folder? My code looks like this

Code: Select all

{new File('H:/videos/Kids TV Shows/', n.replace(':',' -').replace('?','')).exists() ? 'H:/videos/Kids TV Shows/'+n.replace(':',' -').replace('?','') : 'G:/videos/TV Shows/'+n.replace(':',' -').replace('?','')}/{episode.special ? 'Special' : 'Season '+s}{(' (')+vf.match(/720[pP]|1080[pP]/)+(')')}/{n.replaceTrailingBrackets().replace(':',' -').replace('?','')} - S{s.pad(2)}E{es*.pad(2).join('-E').replaceAll('null',{episode.special ? special.pad(2):''})} - {t.replace(':',' -').replace('?','').replacePart (' (Part $1)')}{(' (')+vf.match(/720[pP]|1080[pP]/)+(')')}
Which checks H:\videos\Kids TV Shows\ to see if the series exists there, if it does it uses that drive, if not it uses G:\videos\TV Shows\

All of that works great, however if it detects an HD file it appends (720p) to the Season folder name as well as the end of the file name itself. I only want it to do that if it detects that it needs to go to the G drive, if it uses the H drive just use the naming expression as is except for the {(' (')+vf.match(/720[pP]|1080[pP]/)+(')')} part. Is there a way to add an IF statement refering the the destination file.path[0]? or Something to that effect?
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Binding for destination folder?

Post by rednoah »

Not sure what you want, but one of these should do:

Code: Select all

{root}

Code: Select all

{folder}

Code: Select all

{folder.name}
EDIT: Misread that, you mean the destination, not the source. The destination path is the result of your format. So it's impossible to have a binding. But control the format, and you can make any condition based on any bindings available. I think what you want is just using the same condition in two different places, and nobody is stopping you from doing that. ;)
:idea: Please read the FAQ and How to Request Help.
Tweak_four17
Donor
Posts: 53
Joined: 24 Apr 2014, 19:30

Re: Binding for destination folder?

Post by Tweak_four17 »

Fair enough,I knew the destination had to do with the format but I was hoping it could somehow detect that further into the format. I will attempt to call another .exists()? Statement further along and see if I can make this work..

Thanks!
Tweak_four17
Donor
Posts: 53
Joined: 24 Apr 2014, 19:30

Re: Binding for destination folder?

Post by Tweak_four17 »

Code: Select all

"seriesFormat={new File('H:/videos/Kids TV Shows/', n.replace(':',' -').replace('?','')).exists() ? 'H:/videos/Kids TV Shows/'+n.replace(':',' -').replace('?','') : 'G:/videos/TV Shows/'+n.replace(':',' -').replace('?','')}/{episode.special ? 'Special' : 'Season '+s}{new File('H:/videos/Kids TV Shows/', n.replace(':',' -').replace('?','')).exists() ? '' : (' (')+vf.match(/720[pP]|1080[pP]/)+(')')}/{n.replaceTrailingBrackets().replace(':',' -').replace('?','')} - S{s.pad(2)}E{es*.pad(2).join('-E').replaceAll('null',{episode.special ? special.pad(2):''})} - {t.replace(':',' -').replace('?','').replacePart (' (Part $1)')}{new File('H:/videos/Kids TV Shows/', n.replace(':',' -').replace('?','')).exists() ? '' : (' (')+vf.match(/720[pP]|1080[pP]/)+(')')}
Got it! its long and messy but it seems to work! :D
Post Reply