Page 1 of 1
Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)
Posted: 02 Dec 2021, 22:04
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!

Re: Movies scheme for beginners
Posted: 03 Dec 2021, 02:22
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('.')
}
}
Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)
Posted: 03 Dec 2021, 08:29
by Vessiel
Thanks to your code I understood a lot of things. The first solution is exactly what I was looking for.
Thanks again
Re: Movies scheme for beginners
Posted: 02 Apr 2023, 08:07
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.
Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)
Posted: 02 Apr 2023, 09:07
by rednoah
You can call .replace('ITA', 'iTA') on any String value.
Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)
Posted: 02 Apr 2023, 09:14
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(' ')}
Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)
Posted: 02 Apr 2023, 09:55
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') }
Re: Group languages by audio codec (e.g. ITA.ENG.DTS.JAP.AC3)
Posted: 02 Apr 2023, 09:59
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
and I would like it to be
Thank you