Page 1 of 1
How to add number after subtitles conflicts?
Posted: 14 Feb 2017, 15:07
by easonksh
I have multiple subtitles files in the same language, which I often get conflicting error renaming.
Example:
Love and Death.chi.srt
Love and Death.chi1.srt
When I use
It would just give me back two exact same "Love and Death.chi.srt" with conflicting error.
What should I do to just add a number after one of the "Love and Death.chi.srt"?
Thanks!
Re: How to add number after subtitles conflicts?
Posted: 14 Feb 2017, 15:26
by rednoah
Why do you have two Chinese subtitles? What makes them different? Hearing Impaired? Charset?
You'll have to somehow come up with unique file paths in your format (e.g. by proping the subtitle content, keeping parts of the original filename, etc).
Re: How to add number after subtitles conflicts?
Posted: 14 Feb 2017, 16:01
by easonksh
rednoah wrote:Why do you have two Chinese subtitles? What makes them different? Hearing Impaired? Charset?
You'll have to somehow come up with unique file paths in your format (e.g. by proping the subtitle content, keeping parts of the original filename, etc).
Some of them are Traditional Chinese and some of them are Simplified Chinese, and I am not sure if all the sub files are synced correctly so I just gave them chi1/chi2/chi3...
Re: How to add number after subtitles conflicts?
Posted: 14 Feb 2017, 17:44
by rednoah
{subt} won't work naming standards you've come up with yourself.
You can grab that bit from the filename though:
Re: How to add number after subtitles conflicts?
Posted: 14 Feb 2017, 20:48
by easonksh
Can I actually match only .chi1/.eng/.chi&eng into all new .srt filenames (extracting srt descriptions)?
Using this
instead of
will ignore all other languages sub files.
Thanks for the help, filebot newbie asking so much.
Re: How to add number after subtitles conflicts?
Posted: 14 Feb 2017, 21:14
by rednoah
You could grab the last .whatever bit. That'll work for any language suffix.
e.g.
Re: How to add number after subtitles conflicts?
Posted: 15 Feb 2017, 04:57
by easonksh
Code: Select all
{home}/Steven Spielberg/{y} - {n.replaceAll(/[`´‘'*’?":ʻ,]/, "")}/{n.upperInitial().space('.').replaceAll(/[`´‘*'’?":ʻ,]/, "")}.{y}{'.'+source}.{vf}.{vc}{'.'+group}{'name.chi'.match(/\.\w+$/)}
It now gives me .chi on every files.

Re: How to add number after subtitles conflicts?
Posted: 15 Feb 2017, 06:14
by easonksh
After a bit of stupid trying
Code: Select all
{'.'+fn.match(/chn&eng|cht&eng|chn&eng|chs&eng|eng&chn|eng&chi|eng&chs|eng&cht|chi1|chi2|chi|chn1|chn2|chn3|chn|chs|chs1|cht1|cht2|cht|eng|eng1|eng2|eng/)}
it does give me the results I want but it will match the sub description with the filename itself
which will add an unnecessary .Chs in some of the files like:
-Matchstick.Men.2003.HDTV.mp4
-Matchstick.Men.2003.HDTV.chi.srt
-Matchstick.Men.2003.HDTV.eng&chi.srt
it will give me:
-Matchstick.Men.2003.HDTV.Chs.mp4
-Matchstick.Men.2003.HDTV.Chs.srt
-Matchstick.Men.2003.HDTV.Chs.srt
Re: How to add number after subtitles conflicts?
Posted: 15 Feb 2017, 08:25
by rednoah
You're matching the
chs in Mat
chstick:
http://regexr.com/3f9vs
I use \.
(literal dot) and $
(ending of string) for a reason.
e.g. for testing:
Code: Select all
'Name.HDTV.chi&eng'.match(/\.[a-z&]+$/)
e.g. for your format, using the fn binding and only if the file extension is srt:
Code: Select all
if (ext == 'srt') fn.match(/\.[a-z&]+$/)
This snippet assumes that all your *.srt files end with a .lang suffix.