🗂️MetaLibrary

Learn how to add, edit and delete MetaLibraries and it's folders.

Get One Library

To get a single library, you can use the method query. This will return information about the library with the name "my-library".

wranglebot.query.library.one("my-library").fetch();

Get Many Libraries

If you want to get information about multiple libraries, you can use

wranglebot.query.library.many().fetch();

Add a New Library

The newly created MetaLibrary will be automatically loaded.

To add a new library, you can use the methodpost.one(options);. The options object includes information about the name of the library, the path to the library, any drops associated with the library, and any folders within the library.

const options = {
    "name": "mytest",
    "pathToLibrary": "/Users/axelrothe/test",
    "drops": {
        "foo": "bar"
    },
    "private": false,
    "folders": [
        {
            "name": "01 Footage",
            "watch": true,
            "folders": [
                {
                    "name": "01 Video"
                },
                {
                    "name": "02 Audio"
                }
            ]
        },
        {
            "name": "02 Projects",
            "watch": false,
            "folders": [
                {
                    "name": "01 Premiere"
                },
                {
                    "name": "02 Resolve"
                }
            ]
        }
    ]
}

await wranglebot.query.library.post.one(options); //returns MetaLibrary

Force Load a MetaLibrary

You can force load a MetaLibrary manually.

To force load or unload a library, you can use the methods respectively.

wranglebot.query.library.load("my-library")

Force Unload a MetaLibrary

You can force unload a MetaLibrary manually.

wranglebot.query.library.unload("my-library")

Update a MetaLibrary

Change the folders, drops and other data. To update a library, you can use the method put({...}). The {...} object includes any updates you want to make to the library, such as changes to the path, drops, or folders.

wranglebot.query.library.one("my-library").put({
    "pathToLibrary": "/Users/axelrothe/test2",
    drops: {
        "bar" : "foo"
    },
    "private": true,
    "folders": [
        {
            "name": "01 Projects",
            "watch": true,
            "folders": [
                {
                    "name": "01 Premiere"
                },
                {
                    "name": "02 Resolve"
                }
            ]
        },
        {
            "name": "02 Footage",
            "watch": false,
            "folders": [
                {
                    "name": "01 Video"
                },
                {
                    "name": "02 Audio"
                }
            ]
        },
    ]
});

Update Folders

This is the preferred way to change folders in a MetaLibrary.

To update individual folders in a library, you can use the method folders.put("relative/path/to/folder", {...}). This allows you to update specific settings for a given folder, such as whether it is being watched or the name of the folder.

await wranglebot.query.library.one("my-library").folders.put(
"relative/path/to/folder",
{
    watch: false,
    name: "New Folder Name"
    folders: [
        //...
    ]
})

Delete a MetaLibrary

To delete a library, you can use the method delete()

Note: This will flag the library as deleted and remove it from the cache. It will still be available in the transactions list.

wranglebot.query.library.one("my-library").delete();

Last updated