Modify AMC to rename subtitles using ISO 639-2/B

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
pngl
Posts: 4
Joined: 04 Sep 2014, 13:50

Modify AMC to rename subtitles using ISO 639-2/B

Post by pngl »

I'm using Plex together with filebot and AMC, but Plex misidentifies filebot-generated french subtitles. Plex uses ISO 639-2/B (.fre) and filebot uses ISO 639-2/T (.fra).

I've tried modifying AMC in the following way:

After

Code: Select all

def subtitlesFiles = getMissingSubtitles(...)

I've added

Code: Select all

subtitleFiles = subtitleFiles.collect { name = it.name.replace(".fra",".fre"); it.renameTo(name); new File(name) }
Unfortunately, I get a java.lang.NullPointerException: null from somewhere inside filebot's rename function.

How could I fix this? Or is there some other way I could get my subtitles ending .fre.srt instead of .fra.srt?

One idea I have is that rename re-derives the subtitle name from the file name, adding back .fra at the end. Unfortunately, this would require me to modify filebot to fix the issue.
User avatar
rednoah
The Source
Posts: 23027
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Modify AMC to rename subtitles using ISO 639-2/B

Post by rednoah »

Check the shared scripts section. There's already an example for this kind of use-case.
:idea: Please read the FAQ and How to Request Help.
Post Reply