beaTunes News

Thursday, April 28, 2016

How to use multiple folders in a single, folder-based collection

beaTunes4 logo

A question that comes up every now and then is how to use multiple base-folders in a folder-based library. Folder-based libraries are those, that have nothing to do with iTunes, but basically contain all songs in a given base folder (more info). By default, folder-based libraries are based on a single folder and the beaTunes user interface does not let you add other folders. Despite this, beaTunes 4 is capable of basing folder-based libraries on more than one folder—but it requires a tiny bit of hacking.

beaTunes stores information about music collections in a file called preferences2.xml, which is stored in the folder ~/Library/Application Support/beaTunes/ on OS X and in %LocalAppData%\tagtraum industries\beaTunes\ on Windows. Unfortunately, the folders are a little hard to find on both operating systems. On OS X, ~/Library/ is hidden—use Go -> Go to Folder... in Finder to find it. On Windows, simply copy the mentioned path and paste it into the File Explorer's path field.

Before you open the file, please make sure that beaTunes is not running. Then take a look with your favorite text editor, e.g. Atom. If you're using multiple, folder-based libraries, you should see something like this:

<?xml version="1.0" encoding="UTF-8"?>
<preferences>
    <components>
        <component id="beatunes">
            <file-collection persistentid="7DB1A93611184EB2" selected="true" name="FileSystem">
                <root>/Users/demo_user/folder_a</root>
            </file-collection>
            <file-collection persistentid="7BAF626404544925" name="FileSystem">
                <root>/Users/demo_user/folder_b</root>
            </file-collection>
            [...]
        </component>
        [...]
    </components>
</preferences>

In essence, this describes two folder-based libraries: One based on folder_a and one on folder_b. All you need to do to combine both libraries into one, is to move the <root>-element describing folder_b to the <file-collection>-element containing folder_a. Once that is done, you can remove the now empty <file-collection>-element for folder_b. The result looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<preferences>
    <components>
        <component id="beatunes">
            <file-collection persistentid="7DB1A93611184EB2" selected="true" name="FileSystem">
                <root>/Users/demo_user/folder_a</root>
                <root>/Users/demo_user/folder_b</root>
            </file-collection>
            [...]
        </component>
        [...]
    </components>
</preferences>

Now save the preferences2.xml file, start beaTunes and select the library we just modified. To identify which one it is, open the beaTunes general preferences and open the combo box that lists the existing libraries. When hovering over the items with the mouse, beaTunes will show all root-folders for each library in the tooltip (screenshot). Once the right library is selected, you may need to synchronize via the File menu, if beaTunes isn't doing it automatically.

The example above assumes that you already have multiple folder-based libraries and shows you how to merge them into one. However, multiple libraries are not strictly necessary to add another base-folder to a library. In fact, you can simply add a new <root>-element to an existing <file-collection>, save the file and then start beaTunes (again: don't edit the file while beaTunes is running!). The two things you have to pay attention to though, are overlaps and loops. You should never add a folder to the file collection that is in some form a sub-folder of an already existing <root>-element. Also, you should never create loops in your directory structure, e.g. via symbolic links.

I hope this helps some folks with sprawling libraries. If you have any questions, please don't hesitate to ask.

Labels:

3 Comments:

Blogger תּﻴﻢﻤэҳϋѕﮱﻁﻴ said...

working in version 5?

November 18, 2018 at 7:32:00 AM EST  
Blogger beaTunes said...

Yes

November 18, 2018 at 7:34:00 AM EST  
Blogger Unknown said...

Just what I was looking for! I have music spread across several external hard drives.

March 1, 2021 at 4:05:00 PM EST  

Post a Comment

<< Home