Page 1 of 1

Renaming Subtitles Question

Posted: 15 Aug 2016, 21:02
by failstyle420
First, thank you for this AMAZING-BADASS-COULDN'T DO IT BETTER (For lack of a better word) program!!! The customization in the scripts, the speed, the accuracy and simple to learn/use makes this THE program to have when dealing with media! I signed up almost 2 years ago exactly and haven't had the need to post here because of all the mentioned qualities of this product!

/End Brown Nosing

My current call for movies:

Code: Select all

filebot -script fn:renall "E:/Downloads/Movies" -non-strict -no-xattr --db TheMovieDB --format "D:/Videos/Movies/{n} {'('+fn.replaceAll(/(?i)directors|theatrical|extended|unrated|remastered|ultimate/, '$0 Cut').matchAll(/UNRATED.CUT|REMASTERED.CUT|ULTIMATE.CUT|EXTENDED.CUT|DIRECTORS.CUT|THEATRICAL.CUT/).join('][').upperInitial().lowerTrail()+')'} ({y}) ({source})/{n.colon('  ')} {'('+fn.replaceAll(/(?i)directors|theatrical|extended|unrated|remastered|ultimate/, '$0 Cut').matchAll(/UNRATED.CUT|REMASTERED.CUT|ULTIMATE.CUT|EXTENDED.CUT|DIRECTORS.CUT|THEATRICAL.CUT/).join('][').upperInitial().lowerTrail()+')'} ({y}) {if (ext == 'srt') '.eng'}"
This works FLAWLESSLY, except that it places a space just before ".eng" on my subtitles. I've scoured the forums and all I could do is produce another question:
1. How can I remove the space before ".eng" on my subtitles.
2. I've noticed going through the forums that there are other ways to deal with subtitles, so is there a more "efficient" way of doing what I want with the above code or should this be ok?

Thanks in advance and again, thanks for this amazing program!

Re: Renaming Subtitles Question

Posted: 15 Aug 2016, 21:19
by rednoah
1.
Replace this:

Code: Select all

({y}) {if (ext == 'srt') '.eng'}
With this:

Code: Select all

({y}){if (ext == 'srt') '.eng'}
2.
Recent examples will use the {subt} or {lang} bindings. However, your expression would be the most "efficient" since it doesn't actually do any language detection. ;)

You might be able to use the {tags} binding instead of your matchAll calls.

Re: Renaming Subtitles Question

Posted: 16 Aug 2016, 00:01
by failstyle420
Awesome, I'll give it a try and report back, thank you for the quick response! I'll look into the tags binding, thanks for the heads up!

*EDIT* I could've sworn that I had tried deleting that space already and it didn't work out, but it does now/I was drunk at the time. Thanks again for the help, works beautifully!