Page 1 of 1

Rename video/subtitle files and add language to subtitle at same time

Posted: 16 Feb 2023, 21:55
by kiwichick
Is it possible to rename video and subtitle files together but also add the language code to the subtitle files at the same time?
eg:

Code: Select all

The Love Boat (1976) - S01E23 - Musical Cabins.eng.srt
The Love Boat (1976) - S01E23 - Musical Cabins.mp4
This is the naming format I currently use:

Code: Select all

{n} ({y}) - {s00e00} - {t.removeAll(/[!?.]+$/).colon(', ').replace('(1)', '(Part 1)').replace('(2)', '(Part 2)').replace('(3)', '(Part 3)'}
Then I've just been manually adding .eng to the subtitle files but it would be great if I could do it all at once.

Re: Rename video/subtitle files and add language to subtitle at same time

Posted: 17 Feb 2023, 02:06
by rednoah
Yes. The {plex} format does this by default. Please read FAQ #1 and learn how format expressions work if you are just getting started.


:arrow: Please read the How do I organize files for Plex? guide if you are organizing files for Plex and friends:

Code: Select all

{ plex.id }

:arrow: If you are set on Name (Year) naming (NOTE: good if you happen to just prefer that; not a great choice if you add the year for identification purposes; ID markers are better) then the {emby} format happens to do this by default:

Code: Select all

{ emby }

:arrow: If you are set on writing the format yourself, then you can just add {subt} at the end of your custom format:

Code: Select all

{n} - {s00e00} - {t}{ subt }
subt ... subtitle language tag (only defined for subtitle files; always undefined for video files)