Page 1 of 1

keep / rename cc tag

Posted: 01 Jan 2022, 21:58
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?

Re: keep / rename cc tag

Posted: 02 Jan 2022, 01:26
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 }