Problem renaming with multiple subtitles

All about user-defined episode / movie format expressions
Post Reply
murath
Posts: 2
Joined: 05 Sep 2013, 11:31

Problem renaming with multiple subtitles

Post by murath » 05 Sep 2013, 11:40

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?

User avatar
rednoah
The Source
Posts: 16585
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem renaming with multiple subtitles

Post by rednoah » 05 Sep 2013, 15:10

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"}
:idea: Please read the FAQ and How to Request Help.

murath
Posts: 2
Joined: 05 Sep 2013, 11:31

Re: Problem renaming with multiple subtitles

Post by murath » 06 Sep 2013, 06:23

Ah works like a charm.. thanks.. i also tried some if conditions but couldnt manage to do it.. thumbs up! :)

Post Reply