Jellyfin compatible naming scheme : audio type

Any questions? Need some help?
Post Reply
smellycheese
Posts: 12
Joined: 27 Sep 2025, 23:12

Jellyfin compatible naming scheme : audio type

Post by smellycheese »

Hi,

Following main thread (Jellyfin compatible naming scheme) here is fourth part of the main idea named "audio type"

In French language, there's multiple variant, depending of original country of the movie, but also if it was dubbed by French, Canadian or unspecified actors.

I expect to have the following audio type depending of the rules described below :
VFF, VOF, VOQ, VFQ, VFI, VF2, VOST, VOSTFR, MUET : if this abbreviation exist in original filename, it must be added to new filename.
  • If FRENCH exist in original filename :
Check if the country of origin of the movie is France, if so add VOF (Version Original Francaise = Original French Version) to new filename
if not, check if the country of origin of the movie is Canada, if so add VOQ (Version Original Quebecoise) to new filename
if not, left FRENCH in new filename
  • If nothing match with above rules, check audio language on file metadata.
If FRENCH exist then ADD FRENCH to new filename
If multiple language exist ADD MULTi to new filename
If an audio track language match with country of origin of the movie, with FRENCH subtitle, then add VOSTFR to new filename
If an audio track language match with country of origin of the movie, without FRENCH subtitle, then add VOST to new filename
If an audio track language match with country of origin of the movie, without any subtitle, then add VO to new filename
  • If no audio track is found or couldn't be identified, then add UNKAUD to new filename

For information :
VFI means Internation French Version (= neither dubbed by known French or Canadian actors)
VF2 means that both Canadian and French dubbing are included

Thank in advance
User avatar
rednoah
The Source
Posts: 24412
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Jellyfin compatible naming scheme : audio type

Post by rednoah »

Retaining tags could work via match information from the file path as usual:

Format: Select all

{ fn.match(/VFF|VOF|VOQ|VFQ|VFI|VF2|VOST|VOSTFR|MUET/) }



smellycheese wrote: 28 Sep 2025, 00:05 Check if the country of origin of the movie is France, if so add VOF (Version Original Francaise = Original French Version) to new filename
if not, check if the country of origin of the movie is Canada, if so add VOQ (Version Original Quebecoise) to new filename
if not, left FRENCH in new filename
:?: Can you give me a TMDB link / TMDB ID for a VOF movie / FOQ movie / FRENCH movie. I'd need a test case for each condition. I couldn't think of any movies that fit the bill from the top of my head.




smellycheese wrote: 28 Sep 2025, 00:05 If FRENCH exist then ADD FRENCH to new filename
If multiple language exist ADD MULTi to new filename
If an audio track language match with country of origin of the movie, with FRENCH subtitle, then add VOSTFR to new filename
If an audio track language match with country of origin of the movie, without FRENCH subtitle, then add VOST to new filename
If an audio track language match with country of origin of the movie, without any subtitle, then add VO to new filename
:arrow: I don't have the MediaInfo table for such a file at hand, but I can write some code for you to run tests:

Format: Select all

{
	// If FRENCH exist then ADD FRENCH to new filename
	if (audioLanguages =~ /fra/) 'FRENCH'
}
{
	// If multiple language exist ADD MULTi to new filename
	if (count(audioLanguages) >= 2) 'MULTi'
}
{
	// If an audio track language match with original language of the movie
	if (audioLanguages =~ language) {
		// with FRENCH subtitle, then add VOSTFR to new filename
		// without FRENCH subtitle, then add VOST to new filename
		// without any subtitle, then add VO to new filename
		any{ textLanguages =~ /fra/ ? 'VOSTFR' : 'VOST' }{ 'VO' }
	}
}
:idea: Please read the FAQ and How to Request Help.
smellycheese
Posts: 12
Joined: 27 Sep 2025, 23:12

Re: Jellyfin compatible naming scheme : audio type

Post by smellycheese »

Hello,

Thank a lot !

Few examples, I can provide more

VOF :
https://www.themoviedb.org/movie/8290-l ... vadrouille
https://www.themoviedb.org/movie/108473 ... nte-cristo

VOQ :
https://www.themoviedb.org/movie/15049-bon-cop-bad-cop
https://www.themoviedb.org/movie/881459-farador

Also edited my definition for VFI, just for information. It doesn't change anything (on technical purpose and our concern here) regarding this tag.

I can provide mediainfo output, just let me know what kind of movies, maybe one for each listed case ?

Anyway, I'll test the code and provide a feedback shortly

Regards
User avatar
rednoah
The Source
Posts: 24412
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Jellyfin compatible naming scheme : audio type

Post by rednoah »

smellycheese wrote: 28 Sep 2025, 00:05 If FRENCH exist in original filename :
Check if the country of origin of the movie is France, if so add VOF (Version Original Francaise = Original French Version) to new filename
if not, check if the country of origin of the movie is Canada, if so add VOQ (Version Original Quebecoise) to new filename
if not, left FRENCH in new filename
Here's some code for the VOF / VOQ / FRENCH tags:

Format: Select all

{
	if (fn =~ /FRENCH/ || audioLanguages =~ /fra/) country.match('FR':'VOF', 'CA':'VOQ') ?: 'FRENCH'
}
:idea: Please read the FAQ and How to Request Help.
smellycheese
Posts: 12
Joined: 27 Sep 2025, 23:12

Re: Jellyfin compatible naming scheme : audio type

Post by smellycheese »

Hello,

I would first like to apologize again for the lack of news, we had the opportunity to talk about it briefly, but still.

I've a problem with the audio type block.

As suggested, I tried this :

Groovy: Select all

{
	// If multiple language exist ADD MULTi to new filename
	if (count(audioLanguages) >= 2) 'MULTi'
}
{ fn.match(/VFF|VOF|VOQ|VFQ|VFI|VF2|VOST|VOSTFR|MUET/) }
{
        // If FRENCH exist then ADD FRENCH to new filename
        if (audioLanguages =~ /fra/) 'FRENCH'
}
{
        // If an audio track language match with original language of the movie
        if (audioLanguages =~ language) {
                // with FRENCH subtitle, then add VOSTFR to new filename
                // without FRENCH subtitle, then add VOST to new filename
                // without any subtitle, then add VO to new filename
                any{ textLanguages =~ /fra/ ? 'VOSTFR' : 'VOST' }{ 'VO' }
        }
}
{       if (fn =~ /FRENCH/ || audioLanguages =~ /fra/) country.match('FR':'VOF', 'CA':'VOQ') ?: 'FRENCH'
}
But it seems I didn't specified something, I need only one match from all for each file.

Here is some example of what I get :

source : And.Hope.to.Die.1972.1080p.BluRay.x264.mkv
destination : La.Course.du.lievre.a.travers.les.champs.1972.tmdbid-91571 - 1080p BluRay x264 FLAC FRENCH VOST VOF.mkv
expected : La.Course.du.lievre.a.travers.les.champs.1972.tmdbid-91571 - 1080p BluRay x264 FLAC MULTi VOF.mkv
{audiolanguages} : fra, eng
{country} : FR
>> corner case, Country is FR but 2 audio tracks so VOF but also MULTi, weird but true, I've only few files in this case I think.

source : Anatomie.d.une.chute.2023.VOF.1080p.BluRay.x264.AC3.mkv
destination : Anatomie.d.une.chute.2023.tmdbid-915935 - 1080p BluRay x264 AC3 VOF FRENCH VOSTFR VOF.
expected : Anatomie.d.une.chute.2023.tmdbid-915935 - 1080p BluRay x264 AC3 VOF.mkv
{audiolanguages} : fra
{country} : FR

source : Anchorman.2.The.Legend.Continues.2013.MULTi.1080p.HDLight.X264.AC3.VFF.mkv
destination : Anchorman.2.The.Legend.Continues.2013.tmdbid-109443 - 109443 1080p HDLight x264 AC3 MULTi VFF FRENCH VOSTFR FRENCH.mkv
expected : Anchorman.2.The.Legend.Continues.2013.tmdbid-109443 - 109443 1080p HDLight x264 AC3 MULTi VFF.mkv
{audiolanguages} : fra, eng
{country} : US

source : Angelique.Marquise.Des.Anges.1964.1080p.FR.x264.AC3.mkv
destination : Angelique.Marquise.Des.Anges.1964.tmdbid-44450 - 1080p x264 AC3 FRENCH VO VOF.mkv
expected : Angelique.Marquise.Des.Anges.1964.tmdbid-44450 - 1080p x264 AC3 VOF.mkv
{audiolanguages} : fra
{country} : FR

source : An.American.Haunting.Cauchemar.Americain.2005.MULTi.VF2.1080p.BluRay.x264.mkv
destination : An.American.Haunting.Cauchemar.Americain.2005.tmdbid-10008 - 1080p BluRay x264 AC3 MULTi VF2 FRENCH VOSTFR VOQ.mkv
expected : An.American.Haunting.Cauchemar.Americain.2005.tmdbid-10008 - 1080p BluRay x264 AC3 MULTi VF2.mkv
{audiolanguages} : fra, eng
{country} : CA
>> I checked in mediainfo, I do have 3 audio tracks : 2 with language French (but one is VFF, the other VFQ), 1 with language English.

This last example is a bit tricky (and a corner case) because we could consider that we may have a movie from CA, with a single FRENCH audio track that may be VFF or VFQ, no way to verify this from metadata (sometime track title say if it's VFF or VFQ, but that not always true) so
if no usable tag
only one FRENCH track
country is CA
= VOQ

if 2 FRENCH audio track
country is CA
= VF2

VOST, VOSTFR and VO either if tag is in source filename or not are well identified.

Let me know if you need some mediainfo or additional information.

Thank in advance
User avatar
rednoah
The Source
Posts: 24412
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Jellyfin compatible naming scheme : audio type

Post by rednoah »

:?: Alright, have you tried to modify / rearrange the code to do what you want? We previously established lots of building blocks that you can use, and can modify to fit your needs as necessary.



e.g. Conditional Structures (if-then-else) to do various checks one after another and return the first value that fits any of your checks:

Format: Select all

{
	// If an audio track language match with original language of the movie
	if (audioLanguages =~ language) {
		// with FRENCH subtitle, then add VOSTFR to new filename
		// without FRENCH subtitle, then add VOST to new filename
		// without any subtitle, then add VO to new filename
		return any{ textLanguages =~ /fra/ ? 'VOSTFR' : 'VOST' }{ 'VO' }
	}

	// If file name contains FRENCH or file has a French audio stream
	if (fn =~ /FRENCH/ || audioLanguages =~ /fra/) {
		return country.match('FR':'VOF', 'CA':'VOQ') ?: 'FRENCH'
	}
}


e.g. add MULTi to the file name, this is probably something you want to do independently of the FRENCH stuff, so you'll want to specify that as a separate {...} block:

Format: Select all

{
	// If multiple language exist ADD MULTi to new filename
	if (count(audioLanguages) >= 2) 'MULTi'
}
:idea: Please read the FAQ and How to Request Help.
Post Reply