How do I edit the built-in subt
-
- Posts: 6
- Joined: 27 Jul 2024, 13:31
How do I edit the built-in subt
A quick question... how/where do I edit the built in subt? Is this possible?
Thank you!
Thank you!
Re: How do I edit the built-in subt
Built-in bindings such as {lang} and {subt} subtitle language tag cannot be edited. You can however just not use built-in binding and write your own code instead.
What are you trying to achieve? Feel free to elaborate.
What are you trying to achieve? Feel free to elaborate.
Please read the FAQ and How to Request Help.
-
- Posts: 6
- Joined: 27 Jul 2024, 13:31
Re: How do I edit the built-in subt
That is very helpful - I've been searching too long!
I would like to expand the file name pattern matching for subtitles and then new names. As an example:
1_eng,English.srt
2_eng,English [Forced].srt
3_eng,English [SDH].srt
... all three are mapped & renamed to:
Title.eng
Title.eng
Title.eng
If I rename the Forced and SDH files producing:
1_eng,English.srt
2_eng,English-Forced.srt
3_eng,English-SDH.srt
... the are mapped & renamed to:
Title.eng
Title.eng.forced
Title.eng.SDH
So if I rename the files before FileBot matching, works like a charm as configured. I was curious if I could produce the final file names without pre-renaming them before add/matching in FileBot.
I would like to expand the file name pattern matching for subtitles and then new names. As an example:
1_eng,English.srt
2_eng,English [Forced].srt
3_eng,English [SDH].srt
... all three are mapped & renamed to:
Title.eng
Title.eng
Title.eng
If I rename the Forced and SDH files producing:
1_eng,English.srt
2_eng,English-Forced.srt
3_eng,English-SDH.srt
... the are mapped & renamed to:
Title.eng
Title.eng.forced
Title.eng.SDH
So if I rename the files before FileBot matching, works like a charm as configured. I was curious if I could produce the final file names without pre-renaming them before add/matching in FileBot.
Re: How do I edit the built-in subt
Well, this is pretty bad and unusual...
If you all your files follow this pattern, then Match information from the file path is the way to go:
Code: Select all
1_eng,English.srt
2_eng,English [Forced].srt
3_eng,English [SDH].srt
If you all your files follow this pattern, then Match information from the file path is the way to go:
Format: Select all
{
if (f.subtitle) '.' + fn.match(/_([a-z]{3}),/)
}
{
if (f.subtitle) '-' + fn.match(/\[(.+)\]$/)
}
Code: Select all
.eng-Forced
Please read the FAQ and How to Request Help.
-
- Posts: 6
- Joined: 27 Jul 2024, 13:31
Re: How do I edit the built-in subt
I completely agree - honestly, these source filenames are frustrating to deal with.
Where would I be "pasting" this code? And would this be applied to every file individually?
Thank you so much - this is amazing!!!
Where would I be "pasting" this code? And would this be applied to every file individually?
Thank you so much - this is amazing!!!
Re: How do I edit the built-in subt
You'd add it to your custom format:
https://www.filebot.net/naming.html
I recommend spending ~15min watching all the video tutorials if you're new as this will save you time in the long run:
https://www.filebot.net/tutorials.html
https://www.filebot.net/naming.html
I recommend spending ~15min watching all the video tutorials if you're new as this will save you time in the long run:
https://www.filebot.net/tutorials.html
Please read the FAQ and How to Request Help.
-
- Posts: 6
- Joined: 27 Jul 2024, 13:31
Re: How do I edit the built-in subt
I greatly appreciate your help - this completely rocked!!!
Thank you so much - FileBot is just amazing!!!
Thank you so much - FileBot is just amazing!!!
-
- Posts: 6
- Joined: 27 Jul 2024, 13:31
Re: How do I edit the built-in subt
Oops, one more... this is what I have:
{drive}/Media/{plex.id}
{
if (f.subtitle) '.' + fn.match(/_([a-z]{3}),/)
}
{
if (f.subtitle) '-' + fn.match(/\[(.+)\]$/)
}
... is producing:
Title.eng.eng
Title.eng.eng-Forced
Title.eng.eng-SDH
What syntax change would remove the additional ".eng"?
Appreciate your patience and assistance here.
{drive}/Media/{plex.id}
{
if (f.subtitle) '.' + fn.match(/_([a-z]{3}),/)
}
{
if (f.subtitle) '-' + fn.match(/\[(.+)\]$/)
}
... is producing:
Title.eng.eng
Title.eng.eng-Forced
Title.eng.eng-SDH
What syntax change would remove the additional ".eng"?
Appreciate your patience and assistance here.
Re: How do I edit the built-in subt
The {plex} format already includes the subtitle language and subtitle tags if the file names allow for auto-detection to work. So if your custom code then adds another ".eng" then you will end up with ".eng.eng".
This code matches this bit: 2_eng,English [Forced].srt (i.e. the 3 lower-case letters between _ and , characters; you can remove this bit of code if you don't want to match this bit from the file name)
This code matches this bit: 2_eng,English [Forced].srt (i.e. the letters enclosed in [...] at the end of the file name; you can remove this bit of code if you don't want to match this bit from the file name)
If your files names are good enough for {plex} to work, then you don't need some or all of your Match information from the file path custom code.
If you want {plex} but not the subtitle bit (if any; so you can add that bit yourself with your own custom code) then the manual will help you get started:
This code matches this bit: 2_eng,English [Forced].srt (i.e. the 3 lower-case letters between _ and , characters; you can remove this bit of code if you don't want to match this bit from the file name)
Format: Select all
{
if (f.subtitle) '.' + fn.match(/_([a-z]{3}),/)
}
This code matches this bit: 2_eng,English [Forced].srt (i.e. the letters enclosed in [...] at the end of the file name; you can remove this bit of code if you don't want to match this bit from the file name)
Format: Select all
{
if (f.subtitle) '-' + fn.match(/\[(.+)\]$/)
}
If your files names are good enough for {plex} to work, then you don't need some or all of your Match information from the file path custom code.
If you want {plex} but not the subtitle bit (if any; so you can add that bit yourself with your own custom code) then the manual will help you get started:
rednoah wrote: ↑12 Sep 2016, 10:03 e.g. Movies/Avatar (2009)/Avatar (2009) (i.e. {plex} without subtitle language suffix)e.g. Movies/A/Æon Flux (2005)/Æon Flux (2005)Format: Select all
{ plex ^ null }
Please read the FAQ and How to Request Help.
-
- Posts: 6
- Joined: 27 Jul 2024, 13:31
Re: How do I edit the built-in subt
Okay, got it - these apply sequentially. Removing the first of the two stanzas nailed it and provided normal FileBot excellence on the other file types and the base name.
FileBot is simply fantastic!
FileBot is simply fantastic!