Convert a custom renaming scheme to the format expected by {plex}

All about user-defined episode / movie / file name format expressions
Post Reply
Vessiel
Posts: 3
Joined: 02 Dec 2021, 21:50

Convert a custom renaming scheme to the format expected by {plex}

Post by Vessiel »

Hi all, I'm trying to convert my cartoon series renaming code to the format expected by {plex}, but I can't figure out how I can achieve a similar result.

This is my current code in Filebot.

Code: Select all

{folder}/{n.replaceAll(/[:|]/, " - ")} ({y})
 
[{def resolution = height; def formattedResolution = resolution < 720 ? 'SD' : resolution < 1080 ? 'HD' : resolution < 2160 ? 'Full-HD' : 'UHD'; return formattedResolution}
{def italianLanguagePresent = audio.any {it.LanguageString3?.toUpperCase() == 'ITA'}; def subtitleString = italianLanguagePresent ? '' : ' SUB'; subtitleString}]

/Season {s == 0 ? '00' : s.pad(2)}/

{n.replaceAll(/[:|]/, " - ")} ({y}) - {s00e00} - {t.replaceAll(/[:|]/, " - ").replaceAll(/[?|]/, "_").replaceAll(/["|]/, "'")} 

[{vf + '.'}
{vs.replace('Bluray','BluRay').replace('Blu-ray','BluRay').replace('DVD-R','DVD') + '.'}
{fn.match(/Hybrid/) + '.'}
{fn.match(/REMUX/) + '.'}
{hdr + '.'}
{vcf.replace('MPEG Video','MPEG') + '.'}
{vc}
{'.' + ws}]

{ '[' + audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/) }.collect{ c, a -> a.LanguageString3*.upper().unique().join('.') + '.' + c }.join('.') + ']'}

{ '[' + 'SUB.' + textLanguages.ISO3*.upper().join('.') + ']' }

{ tags }

{[fn.match(/non censurato/)]}

{'.' + fn.match(/v2|v3|v4|v5|v6|v7/).upper()}

With this code I get the following result.

Q:\Air (2005) [Full-HD SUB]\Season 01\Air (2005) - S01E01 - Breeze [1080p.BluRay.AVC.x264.WS][JPN.FLAC][SUB.ITA].mkv

I would like to obtain the same result with the logic of {plex.year.id} so as to also have the unique ID after the year in the folder name.

Can you help me?

Thanks!
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Convert a custom renaming scheme to the format expected by {plex}

Post by rednoah »

:idea: Please read Plex Naming Scheme › Advanced {plex} operators on how to add information to the {plex} path.


:arrow: Here's something to get you started:

Format: Select all

Q:/
{
	plex.year.id
	* { ' [ABC]' }
	% { ' [XYZ]' }
}

Code: Select all

Q:/TV Shows/Alias (2001) {tmdb-2046} [ABC]/Season 05/Alias (2001) - S05E17 - All The Time In The World [XYZ]
:idea: Please read the FAQ and How to Request Help.
Post Reply