Dear all,
it is my first post in this forum and after reading a lot of post, I'm disturbing you since I was not able to understand how to change a filbert behavior.
I have some tv series released as follow
TvSeries.S1.E01.Episode Name.mkv
With the following subtitles
TvSeries.S1.E01.Episode Name.srt
TvSeries.S1.E01.Episode Name.ita.srt
TvSeries.S1.E01.Episode Name.eng.srt
where the first one is the "ita.forced" subtitle. Since it has no tag for language FileBot detects it as a "eng" subtitle. Is there a way to change it forcing FileBot to detect as ita.force this kind of subtitles? I would avoid to have to rename it manually before the parsing... I'm running Filebot on my nas.
Thank you for any suggestion.
"Default" value for {subt} and {lang}
Re: "Default" value for {subt} and {lang}
Sure, something like this will do:
You can read up on how and why this works in the Naming Scheme stickies here in the forums.
This one is more tricky than usual because want a default value for subtitle files only, so there's an extra check there.
Code: Select all
{any{subt}{if (f.subtitle) '.ita-forced'}}
This one is more tricky than usual because want a default value for subtitle files only, so there's an extra check there.
Re: "Default" value for {subt} and {lang}
Thanks rednoah, I tried to change the format following your example but it doesn't seem to work. My educated guess is that FileBot returns eng as subtitle so the condition doesn't apply.
I tried with the sample under episode binding and I obtained lang=eng and subt=.eng for the .srt file with language tag.
I obtain the following result
using the following format
Thanks you again for your help.
I tried with the sample under episode binding and I obtained lang=eng and subt=.eng for the .srt file with language tag.
I obtain the following result
Code: Select all
TvSeries.S1.E01.Episode Name.srt --> TvSeries - S01E01 - Episode Name.eng.srt
TvSeries.S1.E01.Episode Name.ita.srt --> TvSeries - S01E01 - Episode Name.ita.srt
TvSeries.S1.E01.Episode Name.eng.srt --> TvSeries - S01E01 - Episode Name.eng.srt
Code: Select all
{n} - {s00e00} - {t}{any{subt}{if (f.subtitle) '.ita-forced'}}
Re: "Default" value for {subt} and {lang}
Good point. Instead of failing, language-auto detection kicks in, so subt is always defined. It's kinda strange that Italian subtitles would be misidentified as English though.
I guess you'll have to do it the other way around:
Use subt if filename ends with .eng or .ita, and use .ita.forced otherwise for for subtitles, and just nothing for non-subtitle files.
I guess you'll have to do it the other way around:
Code: Select all
{f.subtitle ? fn =~ /[.](eng|ita)$/ ? subt : '.ita.forced' : null}

Re: "Default" value for {subt} and {lang}
Ok. This one works fine! I have to deeply investigate the syntax of this powerful language!
Re: "Default" value for {subt} and {lang}
Just 2 nested ternary operators:
http://docs.groovy-lang.org/latest/html ... y_operator
http://docs.groovy-lang.org/latest/html ... y_operator