Author Topic: enhanced file organisation rules  (Read 12263 times)

Debby747

  • Guest
MusicBee has a powerful automated file-organisation feature!

Edit -> Preferences -> Library ... Music Library - "auto-organise music library files"

Your music files will be automatically renamed (if applicable) and sorted into folders
based on their tag entries, i.e. <artist>, <album>, <year>, <title> etc.

Since names and titles may contain characters which are not valid in file names,
there is a user-definable "Filename Char Mapping" menu which tells MusicBee to exchange those characters,
e.g. you can exchange "?" with "¿"    or    ":" with ";" etc.


1. "move files to folder" - choose where your sorted files will be (re-)located to.

2. "file naming template" - decide how your files will be sorted.

For example
<genre>\<Album Artist>\<Year> <Album>\<Disc-Track#> <Title>
will give you
(FOLDER)\Avant-garde\John Zorn\2006 Moonchild\01-02 Ghosts of Thelema


If an artist released multiple albums within the same year and you want to have them
sorted chronologically,
you can use the "add exception" feature for a nifty workaround. Here's an example:

John Zorn\2006 Astronome\
John Zorn\2006 Moonchild\

In the main panel, choose the files belonging to the first album and edit them -
write "a" into the <custom1> field.
Choose the files belonging to the consecutive album and write "b" in their <custom1> field.


Now go to "Add exception"!

1. "Enter the Criteria for the Exception"
   choose: match "all" of the following rules
2. choose: "Custom1" "has a value"

3. Enter a different "file naming template" for the exception that files contain an entry in <custom1>
   ...\<year>-(<custom1>) <album>\...

This will give you:

John Zorn\2006-(a) Moonchild\
John Zorn\2006-(b) Astronome\

and for all other files MusicBee will use your "general" file naming template:

John Zorn\2008 The Crucible\


So after a little manual work to enhance the tag entries of the concerned music files
MusicBee does all the sorting automatically.
You can choose whatever sorting rules you like, add exceptions to fine-tune and have
a perfectly organised folder structure -
not only in MusicBee itself but in your actual music folder!

Have fun!
Greetings
D.
Last Edit: August 06, 2010, 12:49:07 PM by Debby747

Debby747

  • Guest
Thanks to Elberet who posted this solution to the same task:


Actually, you shouldn't need an exception.

<Album Artist>\<Year><Custom1?null(:%)> - <Album>\<Disc-Track#> <Title>

has pretty much the same effect.

The ?null(X:Y) part tells MusicBee to replace the tag with X if the tag isn't set, and with Y if it is.
In the latter case, % gets replaced with the tag's value, if Y contains one.

Elberet

  • Full Member
  • ***
  • Posts: 167
Here's another example for the ?null() syntax:

<Album><Custom2?null(: [%])>

As before, if the Custom2 field is not used, nothing happens. If it is set, however, the tag's value becomes " [<Custom2>]".
So for any tracks for which you do set the Custom2 field, the end result may look like this:

Metal\Within Temptation\Mother Earth [Limited Edition]\01 Mother Earth.mp3
Metal\Within Temptation\Mother Earth [Digipack]\01 Mother Earth.mp3


Any other tracks (those without the Custom2 field set) will neither have the tag nor the brackets in their filenames or path. :)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
new syntax support in v1.3 which can be used for naming files or in Virtual fields
-    <Left(<field>,n)>
    returns the left n characters of a field value eg. <Left(<Artist>,1)> will return K for artist Kele
-    <Pad(<field>,n)>
    pads a numeric field value to n digits eg. <Pad(<Track#>,3)> will pad track number 6 as 006
-    <IsNull(<field>,true-value,false-value)>
    evaluates whether a field is null and if null, displays true-value otherwise false-value. A value can be text, a field or a combination
    eg. <IsNull(<Year>,<Album>,<Album> - <Year>)>
-    <If(<field>=value,true-value,false-value)>
    evaluates whether a field matches a value. A value can be text, a field or a combination
    eg. <If(<Artist>=<Album Artist>,,<Artist>)> would return blank if the artist was the same as the album artist

    additionally <#> is now supported in virtual fields, where <#> is the position in a playlist. It only makes sense to use the virtual field in a playlist and will display an undefined number when used in other contexts.
    eg. you might want to define a virtual field for the now playing list to combine # and track title:
    <Pad(<#>,2)> - <Title>

ma_t14

  • Sr. Member
  • ****
  • Posts: 2493
Starting from version 1.4.4401 MusicBee additionally supports the following syntax:

- <sort(<field>)> returns the sort value for the field by moving sort prefixes to the end eg. "The Smiths" becomes "Smiths, The"
- <group(<field>,n)> returns a character grouping to n chars eg. <group(<artist>,2)> "Dido" becomes "CD" and ,3 becomes "DEF"
- <first(<field>)> - returns the first value from a multi-value field eg. if you have multiple artists for a file <first(<artist>)> will return the first one
- naming rules can now include <= and >= in a condition (so its now =,>,>=,<,<=)
- when using ratings in conditions, the rating scale is 0-100 but its more natural to use 0-5 so the rating comparisons are now normalised for 0-100 scale
- use "(" or ")" to include ( or ) as literal text (using ( by itself conflicts when used inside a function)
- fixes handling for \\ in a filepath