keep / rename cc tag

Any questions? Need some help?
Post Reply
Posts: 5
Joined: 07 Sep 2016, 01:47

keep / rename cc tag

Post by Ch3vr0n »

Doing some optimizing in my media library. For subtitles i have 3 options available at the most. Some titles may have 1 while others may have all 3 language options. Those subtitle language options are

.nl, .en, and

However i noticed that for some they're .en[cc].srt and for others

For playback i primarily use plex and just now noticed it properly tags as English HH (Hard of Hearing), but on first glance it doesn't for files named .en[cc].srt

I can't figure out how to rename all .en[cc] to, AND keep the .cc tag. My current format "{n} - {s00e00} - {t}{'.'+lang.ISO2}" strips the language to .en entirely. Any quick way to fix that?
User avatar
The Source
Posts: 20487
Joined: 16 Nov 2011, 08:59

Re: keep / rename cc tag

Post by rednoah »


Code: Select all

{ '.' + fn.match(/\b(cc)\b/) }
:idea: We use the \b word boundary because we want to match [cc] but not accent.

:arrow: [SNIPPET] Match information from the file path

You can use if-then-else if you want to add .HI to files that match the given cc pattern:

Code: Select all

{ fn =~ /\b(cc)\b/ ? '.HI' : null }
:idea: Please read the FAQ and How to Request Help.
Post Reply