Hi
I am in the process of writing my own groovy script for renaming movies and tv shows. To get some inspiration i have been trying the different scripts and seem to have found a bug or unfortunate implementation of getting subtitles.
Lets look at the following script:
def files = dir.listFiles{ it.isVideo() }
files += getMissingSubtitles(file:files[0])
rename(file:files, db:'TVRage', format:tvFormat, strict:false)
This script will get the subtitle but when calling the rename fuction it will remove the .eng. from the subtitle. Is there any way to fix this? The reason i dont just rename the video file first and then get the subtitle is that then i cant move there new location.
Also I was wondering if i should rename the video file first, then download the subtitle based on the correct name. I mean when you do a search on name it is probably easier to find the subtitle if it search on the correct name?
Subtitle and renaming
Re: Subtitle and renaming
It's all in your format. Just use {'.'+lang} in the format. It'll fail for movies but give u the 3-letter language code for subtitles files.
Also the original release name will help finding the best matching subtitle. If hash-lookup works name doesn't matter, but in general subs are uploaded and match the release name, so filebot will auto-select the best match looking at file/subtitle names.
Also the original release name will help finding the best matching subtitle. If hash-lookup works name doesn't matter, but in general subs are uploaded and match the release name, so filebot will auto-select the best match looking at file/subtitle names.
Re: Subtitle and renaming
Thanks for the anwser
this is great.

Re: Subtitle and renaming
Hi again
Could you also help me with this. I would like to use getMedieInfo to check if a mkv file contains english subtitles. Is this possible?
Best regards
Could you also help me with this. I would like to use getMedieInfo to check if a mkv file contains english subtitles. Is this possible?
Best regards
Re: Subtitle and renaming
Code: Select all
getMediaInfo(file:f, format:'''{media.TextLanguageList}''') =~ /English/
Re: Subtitle and renaming
Great, thanks 
Is it possible to get a list of functions on the media type?

Is it possible to get a list of functions on the media type?
Re: Subtitle and renaming
If you play with the GUI you can see everything. Basically media.* gives access to all the MediaInfo "General" fields.
Re: Subtitle and renaming
Okay great 
I used your hack and added both nfo and html to sub list in media.types. There is still no other way then doing this if i want filebot to rename them right?

I used your hack and added both nfo and html to sub list in media.types. There is still no other way then doing this if i want filebot to rename them right?
Re: Subtitle and renaming
As long as video, nfo, html, etc are processed in the same batch and have exactly the same filename, they will be renamed just the same.
e.g.
e.g.
Code: Select all
Auto-detect movie from context: [D:\testdata\AMC-TEST\Unforgiven.1992.1080p.BluRay.x264-WPi.avi]
[TEST] Rename [D:\testdata\AMC-TEST\Unforgiven.1992.1080p.BluRay.x264-WPi.avi] to [Unforgiven (1992).avi]
[TEST] Rename [D:\testdata\AMC-TEST\Unforgiven.1992.1080p.BluRay.x264-WPi.any] to [Unforgiven (1992).any]
Processed 2 files