Different directory structures?

  • Lyall Pearce

    Lyall Pearce - 2011-04-08

    I set my '/homemybome/Movies' directory for full scan/inotify, etc. All wonderful.
    I browse to PC Directory->home/myhome/Movies, everything looks great. All directories, as expected.

    Then, I browse to 'Video -> Directories -> Movies' and things are different

    Specificially, inside my Movies directory I have directories of a single uppercase letter for each letter of the alphabet, representing the first character of the name of the video clip plus a directory '0-9' for those numeric videos.

    In the 'Video -> Directories', the 'Movies/T' directory shows up not under 'Movies', but further down, after the 'Other' folder.
    No 'T' directory shows up inside the 'Movies' container.

    The 'T' directory is correctly populated with it's contents, however.

    I have attempted to completely delete my 'Movies' and re-add it, but the 'T' container insists on being in the wrong place.

    I am using MediaTomb 0.12.1
    MySQL version 5.1

    Suggestions as to what is going on?

  • cojms1

    cojms1 - 2011-04-16

    Hi lyallpearce,

    I do something very similar.  The snippet below is used to create a structure for TV shows and Films.  Currently it is based on the path that the file is stored in.  Maybe it will help…

    function addVideo(obj)
      /**** Set the Title and build the folder structure ****/
      var chain = loc.split("/");
      /* set the title */
      var title = chain[chain.length - 1];
      var pos = title.lastIndexOf('.');
      if (pos > 1) {
        title = title.substring(0, pos);
      obj.title = title;
      /****  Films (so adjust the structure) ****/
      var pos = loc.indexOf("/Films/");
      if (pos != -1) {
        /* create the genre chain */
        pos = chain.indexOf('Films');
        chain.splice(pos,0, 'Genre');
        /* create the virtual objects */
        addCdsObject(obj, createContainerChain(chain));
        chain = new Array('Films', 'All Films', getFirstLetter(title).toUpperCase());
      addCdsObject(obj, createContainerChain(chain)); /* add the object for the item */
    function getFirstLetter(title) {
      var ignore = ["a", "the"];
      var first = title.charAt(0);
      for (var i = 0; i < ignore.length; i++) {
        if (title.substr(0, ignore[i].length + 1).toLowerCase() == ignore[i] + " ") {
          var first = title.charAt(ignore[i].length + 1);
      var temp = parseInt(first, 10);
      if (!isNaN(temp)) {
        first = "[0-9]";
      return first;
  • cojms1

    cojms1 - 2011-04-16

    Sorry forgot to mention that my files are stored as /Films/<genre>/<collection_name>/<filename>, e.g. /Films/Adventure/National Treasure/National Treasure - Book Of Secrets.mp4 or /Films/Adventure/The Goonies.mp4

    TV episodes are stored in the filesystem as /TV/<show_name>/<season>/Episode 01.mp4 etc.


Log in to post a comment.