Automatically add "forced" to new name?

Support for Windows users
Post Reply
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Automatically add "forced" to new name?

Post by Biff »

How could FileBot automatically add "forced" to files like "ehd-fufr-x264-forced.sub" when renaming?

I assume, I have to add anything to the:

Code: Select all

I:\Eigene Dateien\Videos\Filme\{n.replace(':', ' -')} ({y}){' CD'+pi}{tags}{file.path =~ /Kinofassung/ ? '[Theatrical Cut]' : ''}\{n.replace(':', ' -')} ({y}){' CD'+pi}{'.'+lang}{tags}{file.path =~ /Kinofassung/ ? '[Theatrical Cut]' : ''}
Newest portable, stable FileBot, Windows 10 Home, 64bit
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automatically add "forced" to new name?

Post by rednoah »

Use the {subt} binding.
:idea: Please read the FAQ and How to Request Help.
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Re: Automatically add "forced" to new name?

Post by Biff »

Thank you very much, rednoah,

Where have I do add it?

Many thanks again
Newest portable, stable FileBot, Windows 10 Home, 64bit
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automatically add "forced" to new name?

Post by rednoah »

In your format. Probably at the end somewhere.
:idea: Please read the FAQ and How to Request Help.
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Re: Automatically add "forced" to new name?

Post by Biff »

Very great, thank you very much.

How could I add the language additionally.

Many thanks again
Newest portable, stable FileBot, Windows 10 Home, 64bit
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automatically add "forced" to new name?

Post by rednoah »

{subt} includes the ISO 3-letter 2B code.
:idea: Please read the FAQ and How to Request Help.
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Re: Automatically add "forced" to new name?

Post by Biff »

Sounds great, what does that mean?
Newest portable, stable FileBot, Windows 10 Home, 64bit
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automatically add "forced" to new name?

Post by rednoah »

{subt} will give you values like .eng or .eng-forced which presumably is what you asked for.

Open the Format Editor and play with it. That's the best way to learn how various bindings work.
:idea: Please read the FAQ and How to Request Help.
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Re: Automatically add "forced" to new name?

Post by Biff »

Alright, I will do so, thank you very much
Newest portable, stable FileBot, Windows 10 Home, 64bit
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Re: Automatically add "forced" to new name?

Post by Biff »

When I add {subt} here (or else where)

Code: Select all

I:\Eigene Dateien\Videos\Filme\{n.replace(':', ' -')} ({y}){' CD'+pi}{tags}{file.path =~ /Kinofassung/ ? '[Theatrical Cut]' : ''}\{n.replace(':', ' -')} ({y}){' CD'+pi}{'.'+lang}{tags}{file.path =~ /Kinofassung/ ? '[Theatrical Cut]' : ''}{subt}
"forced" is not added to the renamed files, these are the source files:
cinema-absolutely.fabulous.movie.780p-forced.sub
cinema-absolutely.fabulous.movie.780p-forced.idx

How could one correct it?
Newest portable, stable FileBot, Windows 10 Home, 64bit
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automatically add "forced" to new name?

Post by rednoah »

1.
Subtitles should conform with .<lang>-forced.<ext> naming.


2.
If you want to grab the "forced" from anywhere in the filename, then you can just match it from the filename:

Code: Select all

fn.match(/forced/)
:idea: Please read the FAQ and How to Request Help.
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Re: Automatically add "forced" to new name?

Post by Biff »

Thank you very much.

When I add this

Code: Select all

I:\Eigene Dateien\Videos\Filme\{n.replace(':', ' -')} ({y}){' CD'+pi}{tags}{file.path =~ /Kinofassung/ ? '[Theatrical Cut]' : ''}\{n.replace(':', ' -')} ({y}){' CD'+pi}{'.'+lang}{tags}{file.path =~ /Kinofassung/ ? '[Theatrical Cut]' : ''}fn.match(/.forced/)
it is renamed to:
Image

And adding this - .<lang>-forced.<ext> - adds "-forced" to all of the renamed files.

How could I correct it?

Very many thanks again
Newest portable, stable FileBot, Windows 10 Home, 64bit
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automatically add "forced" to new name?

Post by rednoah »

I've replied to your questions slightly less than 150 times and yet you're still struggling with the basics. Evidently, if I make it too easy you'll just copy and paste the solution and never think why or how that solution works.

This is clearly Groovy code, not something you want to literally have in your output path:

Code: Select all

fn.match(/forced/)
Format Expressions use {...} to separate Groovy code sections (where you can use variables and functions) from literal sections.

It's not that hard. There's plenty of examples here in the forums. If you play with it for a few minutes you will figure it out. ;)

@see viewtopic.php?f=5&t=1895
:idea: Please read the FAQ and How to Request Help.
Biff
Posts: 241
Joined: 02 Mar 2014, 17:52

Re: Automatically add "forced" to new name?

Post by Biff »

Thank you very much for the link. And sorry for causing almost 150 replies.

Well, yes, the brackets. It appears to work great now.

Many thanks again
Newest portable, stable FileBot, Windows 10 Home, 64bit
Post Reply