keep / rename cc tag

Any questions? Need some help?
Post Reply
Ch3vr0n
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 .en.cc

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

For playback i primarily use plex and just now noticed it properly tags .en.cc 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 .en.cc, 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
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: keep / rename cc tag

Post by rednoah »

e.g.

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