Page 1 of 1

Problem renaming with multiple subtitles

Posted: 05 Sep 2013, 11:40
by murath
I also store english and turkish subtitles in the same directory. What i want to do is, while renaming deleting the "tur" suffix and keeping the "eng" suffix because i use my movies with the LcdTv which doesnt support subtitle selection..

So what i want my files to look like is this:
A.Christmas.Carol[2009]DVDRip.360p.2ch.XviD-FXG(6.7).avi
A.Christmas.Carol[2009]DVDRip.360p.2ch.XviD-FXG(6.7).srt
A.Christmas.Carol[2009]DVDRip.360p.2ch.XviD-FXG(6.7)-EN.srt

My code is:
{n.upperInitial().space('.').replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail()}{"[$y]"}{"$source"}{".$vf"}{".$af"}{".$vc"}{"-$group"}{"($imdb.rating)"}{"CD$pi"}{if (lang == 'eng') "-EN"}

But i didnt manage to get a proper result. Can anybody help me with this issue?

Re: Problem renaming with multiple subtitles

Posted: 05 Sep 2013, 15:10
by rednoah
lang is a Locale object, so you'll need to grab this property if you want to compare the String value:

Code: Select all

{if (lang.ISO3Language == 'eng') "-EN"}

Re: Problem renaming with multiple subtitles

Posted: 06 Sep 2013, 06:23
by murath
Ah works like a charm.. thanks.. i also tried some if conditions but couldnt manage to do it.. thumbs up! :)