import.js and addVideo function.

2011-02-10
2013-05-30
  • Alex Anderson
    Alex Anderson
    2011-02-10

    After spending nearly a day building and installing SpiderMonkey, I took a look at the Mediatomb scripting documentation and the import.js script itself only to realize I am still yet unable to make sense of JavaScript..  My current import.js is the same as the default, and my add video function reads as follows:

    function addVideo(obj)
    {
        var chain = new Array('Video');
        addCdsObject(obj, createContainerChain(chain));
        var dir = getRootPath(object_root_path, obj.location);
        if (dir.length > 0)
        {
            chain = new Array('Video');
            chain = chain.concat(dir);
            addCdsObject(obj, createContainerChain(chain));
        }
    }
    

    While this displays my video content as:

    /Video
         -Directories
              +Movies
              +Television
    

    I want it displayed as:

    /Video
         +Movies
         +Television
    

    What values/functions must I change to achieve this?

     
  • BT
    BT
    2011-02-10

    So you have modified the addVideo function but the changes aren't showing? If this is the case then it appears you haven't set the following in config.xml:

    <virtual-layout type="js">
    

    By default the virtual-layout type is set to builtin, but you need to set it to js.