Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)

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

Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)

Post by Vessiel »

Hi, I would like my movies to have this format:

Code: Select all

City Hunter - Private Eyes (2019) - BluRay.1080p.x264.ITA.DTS.JAP.AC3.Subs.ITA.JAP.[Group]
with DVD or BluRay or WEB.

If there are two or more languages ​​with the same codec I would like them like this:

Code: Select all

City Hunter - Private Eyes (2019) - BluRay.1080p.x264.ITA.ENG.DTS.JAP.AC3.Subs.ITA.JAP.[Group]
Is it possible?

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

Re: Movies scheme for beginners

Post by rednoah »

Possible but not easy. Intricate custom requirements will require a fair bit of programming experience to create and maintain. Definitely not recommended for beginners.


If you already have a format, then you can just add something like this at the end:

Code: Select all

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


If you want to integrate with the {plex} format then then it'll get a bit more tricky:

Code: Select all

X:/Media/
{
	plex.derive
	{ ' - ' }
	{ allOf
		{ vs } 
		{ vf }
		{ audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/) }.collect{ c, a -> a.LanguageString3*.upper().unique().join('.') + '.' + c }.join('.') }
		{ 'Subs.' + textLanguages.ISO3*.upper().join('.') } 
		{ '[' + group + ']' }
		.join('.')
	}
}
:idea: Please read the FAQ and How to Request Help.
Vessiel
Posts: 3
Joined: 02 Dec 2021, 21:50

Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)

Post by Vessiel »

Thanks to your code I understood a lot of things. The first solution is exactly what I was looking for.

Thanks again
Braciata
Posts: 3
Joined: 02 Apr 2023, 08:03

Re: Movies scheme for beginners

Post by Braciata »

rednoah wrote: 03 Dec 2021, 02:22 Possible but not easy. Intricate custom requirements will require a fair bit of programming experience to create and maintain. Definitely not recommended for beginners.


If you already have a format, then you can just add something like this at the end:

Code: Select all

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


If you want to integrate with the {plex} format then then it'll get a bit more tricky:

Code: Select all

X:/Media/
{
	plex.derive
	{ ' - ' }
	{ allOf
		{ vs } 
		{ vf }
		{ audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/) }.collect{ c, a -> a.LanguageString3*.upper().unique().join('.') + '.' + c }.join('.') }
		{ 'Subs.' + textLanguages.ISO3*.upper().join('.') } 
		{ '[' + group + ']' }
		.join('.')
	}
}
Hello!
I have a question. What if I would like to add Italian as my preferred language and replace 'ITA' with 'iTA'?
Thank you so much.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)

Post by rednoah »

You can call .replace('ITA', 'iTA') on any String value.
:idea: Please read the FAQ and How to Request Help.
Braciata
Posts: 3
Joined: 02 Apr 2023, 08:03

Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)

Post by Braciata »

rednoah wrote: 02 Apr 2023, 09:07 You can call .replace('ITA', 'iTA') on any String value.
This is what I tried but I couldn't manage it to work.

That's what I tried. Maybe wrong position?

Code: Select all

{ audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/).replace('ITA', 'iTA')}.collect{ c, a -> a.LanguageString3*.upper().unique().join('-') + ' ' + c }.join(' ')}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)

Post by rednoah »

This code does the group by audio codec, so that's completely unrelated to the language, so adding some replacement there does nothing:

Code: Select all

audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/) }
You'll wanna do the iTA replacement on the final result:

Code: Select all

{ '.' + audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/) }.collect{ c, a -> a.LanguageString3*.upper().unique().join('.') + '.' + c }.join('.').replace('ITA', 'iTA') }
:idea: Please read the FAQ and How to Request Help.
Braciata
Posts: 3
Joined: 02 Apr 2023, 08:03

Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)

Post by Braciata »

rednoah wrote: 02 Apr 2023, 09:55 This code does the group by audio codec, so that's completely unrelated to the language, so adding some replacement there does nothing:

Code: Select all

audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/) }
You'll wanna do the iTA replacement on the final result:

Code: Select all

{ '.' + audio.groupBy{ a -> a.format.removeAll(/[^A-Z0-9]/) }.collect{ c, a -> a.LanguageString3*.upper().unique().join('.') + '.' + c }.join('.').replace('ITA', 'iTA') }
This worked :) Thank you.
Do you know if I can set italian language as my first choice? In some movies I get something like

Code: Select all

.ENG.SPA.iTA.EAC3
and I would like it to be

Code: Select all

.iTA.ENG.SPA.EAC3
Thank you
Post Reply