Menu

Categorising Videos

Help
Anonymous
2007-10-24
2013-05-30
  • Anonymous

    Anonymous - 2007-10-24

    I store my videos in a set directory structure /pub/videos/SHOW/SEASON/FILE, for example /pub/videos/battlestar_galactica/season_3/01 - Occupation.mp4, or /pub/videos/firefly/01 - Serenity.mp4 when the season isn't appropriate, which I'd like to replicate in Media Tomb.  I changed the addVideo function in import.js as follows, but everything still gets loaded into the Videos section with no sub tree created.

    function addVideo(obj)
    {
        var chain, show, season;
        var location = obj.location.replace(/_/g," ").split('/');

         chain = new Array('Video');

         if (location.length > 3) {
            chain.push(location[2]);
            if (location.length > 4) { chain.push(location[3]); }
          }

          addCdsObject(obj, createContainerChain(chain));
    }

    So I tried something simpler

    function addVideo(obj)
    {
        var chain = new Array('Video', 'Level2');

        obj.meta[M_TITLE] = obj.title;

        addCdsObject(obj, createContainerChain(chain));
    }

    but I don't get a Level2 folder.  I've got Javascript (spidermonkey 1.6) support compiled into the SVN source using Gentoo.

    Anyone had any luck with anything like this?

    Richard

     
    • Jin

      Jin - 2007-10-25

      By default a builtin layout function is used, in order to activate the use of import.js you have to switch the scripting type from builtin to js in your config.xml

      Since you do not seem to see any changes after modifying import.js I figured that you might have forgotten to activate js in the configuration?

      And btw, you need to reimport the media in question in order to see the new layout (i.e. stuff that is already in the database does not get automatically updated to the new import script)

      Too bad they cancelled Firefly... BSG rocks :>

      Jin

       
    • Anonymous

      Anonymous - 2007-10-25

      COOOOOOOOOOOOOOOOOL!!!  Its worked, thanks Jin.  You were right I hadn't changed the scripting type :DOH:

      Just as a thought it might be nice to be able to optionally specify an import script for each directory, allowing them to be handled differently.

      The third season of BSG was a bit slow going in the middle and there's rumours of a second Serenity film floating about.  Really enjoying Heroes at the moment.

      If you've no objections I may work on getting the web interface to work on Safari.

      Richard

       
    • John Gorkos

      John Gorkos - 2007-11-27

      I found this to be extremely useful, but my directory structure is different.
      I solved this by counting backward, not forward, when building my chains.

      for videos in
      /mnt/disk1/share/video/tv/24/Season_1/S01E01 - Go Jack Go.avi ...
      /mnt/disk1/share/video/tv/Numb3rs/Season_1/S01E01 - Math Geeks Rule.avi

      (basically, /x/...../y/z/show/season/file.avi

      function addVideo(obj)
      {
      var chain, show, season;
      var location = obj.location.replace(/_/g," ").split('/');
       
      chain = new Array('Video');
       
      if (location.length > 3) {
      chain.push(location[location.length-3]);
      if (location.length > 4) { chain.push(location[location.length-2]); }
      }
       
      addCdsObject(obj, createContainerChain(chain));
      }

      Anyway, hope it works for someone else.  I've got MediaTomb running on a Debian-Etch 500G LinkStation Live feeding two different Buffalo LinkTheaters with no problems at all, now that I can automatically build media trees.

      John

       
    • Jin

      Jin - 2007-11-28

      Nice, thanks for the feedback!

       

Log in to post a comment.