use audio.language to move files to language folders?

Any questions? Need some help?
Post Reply
lordfiSh
Posts: 5
Joined: 16 Oct 2016, 08:22

use audio.language to move files to language folders?

Post by lordfiSh »

Hey,
can someone help me to write a format experssion that moves my EN movies (based on audio.language) to folder1 and movies with language X to folder2?
I found a part in this thread, but im not 100% sure whats the right syntax is

Code: Select all

sudo filebot -script 'fn:amc' '/volume1/downloads' --output /volume1/sorted --def movieFormat="{audio.size() > 1 ? 'movie-en' : 'de' in audio.language ? 'movie-de' : 'movies'}/{n} ({y})/{fn}" --action test -non-strict --conflict auto --lang de
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: use audio.language to move files to language folders?

Post by rednoah »

Use the Format Editor to prototype your format (just in case you're testing formats on the command-line).

Try this:

Code: Select all

{'en' in audio.language ? 'English' : 'No English'}
:idea: Please read the FAQ and How to Request Help.
zacha
Posts: 1
Joined: 11 Apr 2017, 13:01

Re: use audio.language to move files to language folders?

Post by zacha »

Hello!

I have a similar problem I want to sort all media in folders according to the first audio language. What I tried was

movieFormat = {audio.language[0].toUpperCase()}/Movies/ ..... and so on.

This works as long as the audio stream #0 has a languaga meta information set, but I want a fallback option like:

movieFormat = {audio.language[0] == null ? 'DE' : audio.language[0].toUpperCase()}

but it does not work like this, I tried everything I could imagine, e.g.

{'es' in audio.language[0] ? 'ES' : ('en' in audio.language[0] ? 'EN' : 'DE')}

Which for my understanding should always fall back to 'DE' if the other tests result in false, but it seems these are not executed at all if the video does not have audio.language set. I tried in the format editor and in works within this one but complains that no Binding 'null' is undefined.

Any Idea how I can circumvent this?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: use audio.language to move files to language folders?

Post by rednoah »

e.g.

Code: Select all

{any{audioLanguages[0].name}{'Undefined'}}

Code: Select all

{any{audioLanguages[0].ISO3.upper()}{'UND'}}
@see viewtopic.php?f=5&t=1895
:idea: Please read the FAQ and How to Request Help.
Post Reply