Welcome Guest

Pages: 1
Sort based on format? (FLAC, mp3, aac, etc.)
2manyFLACPostSeptember 20, 2015, 07:54
Newbie
Posts: 12
Registered:
September 20, 2015, 11:49
Normal topicSort based on format? (FLAC, mp3, aac, etc.)

I would like to sort based on the format of the music file at the highest level of my folder structure so I can quickly avoid things like transcoding mp3 files or aac files.

So it would be

/format/artist/year - album/track - title

Is this possible with Yate? I have managed everything after /format/ with one action.

Thanks!

2MR2PostSeptember 20, 2015, 12:18
Avatar photo
Administrator
Posts: 2364
Registered:
August 23, 2012, 19:27
Normal topicRe: Sort based on format? (FLAC, mp3, aac, etc.)

It's possible. It depends on what you mean by 'format'.

You can extract the filename extension via:

Get Property File Extension -> Variable 1

Making it upper case will probably be nicer:

Case UPPER in Variable 1

Alternately you can extract the stream type:

Get Property Stream -> Variable 1

or you make sure m4a, m4v and mp4 are the same and aiff, aifc and aif are the same while other types are unchanged.

Set the action test state to true for audio type: mpeg-4
if true
Set Variable 1 to "MPEG-4"
else
Set the action test state to true for audio type: aiff
if true
Set Variable 1 to "AIFF"
else
Comment every other type has only one extension
Get Property File Extension -> Variable 1
Case UPPER in Variable 1
endif
endif

You can force the 'Year - Album' into a variable as follows:

Set Variable 2 to "\[Year] - \[Album]"

Note that when entering the above in the Set statement use the context menu 'Insert Yate Field' submenu to insert the fields correctly. If you look at this in an email as opposed to the forum, the backslashes are typically missing.

If you do any combination of the above you will have the 'format' in variable 1 and the 'year - album' in variable 3. Along with 'Artist' you now have three path components. You can use a Move statement which specifies the three paths and a rename template to do the filename. That should do what you want.

If the group of files is not consistent in the results you'll get for variable 1 and variable 3 make sure to put a 'Force Grouped' statement as the first line of the action to handle each file individually.

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.051 seconds.