Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Help with recursive directory adding

Anonymous
2010-11-01
2013-05-30

  • Anonymous
    2010-11-01

    Hello,
    I've been searching for an answer to this with no luck, so hopefully I'm not repeating an earlier question.  When I am adding media to MT 0.12.1, I click on a main directory in Filesystem view, select Timed, Full, Recursive and a scan interval of the default 1800.  It then scans and adds all media to MT, but in a somewhat random order.  As an example:

    The main directory is called "TV".  In that I have a directory called Batman The Animated Series, which in turn has 4 directory inside of that - Season 1, Season 2, Season 3, Season 4.  Also in the TV directory is another sub, called Battlestar Galactica.  This has no subdirectories inside of it:
    -TV
    ---Batman The Animated Series
    ----Season 1
    ----Season 2
    ----Season 3
    ----Season 4
    ---Battlestar Galactica

    What I get when I do a recursive scan on "TV" is the following:
    -Video
    ---All Video
    ---Directories
    ----Batman The Animated Series
    -----Season 2
    -----Season 4
    ----Season 1
    ----Season 3
    ----TV
    -----Battlestar Galactica

    Any idea why it's not nesting properly?

     
  • Lyall Pearce
    Lyall Pearce
    2010-11-24

    A couple of questions.
    What OS are you running MediaTomb on?
    What file system type is the TV folder in?
    What is the back-end storage of MediaTomb? I use mysql

    Personally, I use 'Scan Mode=inotify, Initial Scan=Full, Recursive'
    I am running under Gentoo Linux and use NTFS filesystem to contain my directories.

    Maybe it's a problem with your MediaTomb config, here is mine…

    <?xml version="1.0" encoding="UTF-8"?>
    <config version="2" xmlns="http://mediatomb.cc/config/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd">
      <server>
        <ui enabled="yes" show-tooltips="yes">
          <accounts enabled="no" session-timeout="30">
            <account user="mediatomb" password="mediatomb"/>
          </accounts>
        </ui>
        <name>Lyalls Media</name>
        <udn>uuid:931b05c8-815a-41ec-8503-3e90005caf98</udn>
        <home>/var/lib/mediatomb</home>
        <webroot>/usr/share/mediatomb/web</webroot>
        <storage caching="yes">
          <sqlite3 enabled="no">
            <database-file>mediatomb.db</database-file>
          </sqlite3>
          <mysql enabled="yes">
            <host>localhost</host>
            <database>mediatomb</database>
            <username>**suppressed**</username>
            <password>**suppressed**</password>
          </mysql>
        </storage>
        <protocolInfo extend="yes"/>
        <pc-directory upnp-hide="no"/>
        <extended-runtime-options><!-- 0.1.12 upwards -->
          <ffmpegthumbnailer enabled="yes">
            <thumbnail-size>160</thumbnail-size>
            <seek-percentage>10</seek-percentage>
            <filmstrip-overlay>no</filmstrip-overlay>
            <workaround-bugs>no</workaround-bugs>
            <image-quality>8</image-quality>
          </ffmpegthumbnailer>
          <mark-played-items enabled="yes" suppress-cds-updates="yes">
            <string mode="prepend">*</string>
            <mark>
              <content>video</content>
            </mark>
          </mark-played-items>
          <lastfm enabled="no">
            <username>username</username>
            <password>password</password>
          </lastfm>
        </extended-runtime-options>
      </server>
      <import hidden-files="no">
        <scripting script-charset="UTF-8">
          <common-script>/usr/share/mediatomb/js/common.js</common-script>
          <playlist-script>/usr/share/mediatomb/js/playlists.js</playlist-script>
          <virtual-layout type="builtin">
            <import-script>/usr/share/mediatomb/js/import.js</import-script>
          </virtual-layout>
        </scripting>
        <mappings>
          <extension-mimetype ignore-unknown="yes">
            <map from="mp3" to="audio/mpeg"/>
            <map from="m4a" to="audio/mp4"/>
            <map from="m4v" to="video/mp4"/>
            <map from="mov" to="video/x-quicktime"/>
            <map from="ogx" to="application/ogg"/>
            <map from="ogv" to="video/ogg"/>
            <map from="oga" to="audio/ogg"/>
            <map from="ogg" to="audio/ogg"/>
            <map from="ogm" to="video/ogg"/>
            <map from="asf" to="video/x-ms-asf"/>
            <map from="asx" to="video/x-ms-asf"/>
            <map from="wma" to="audio/x-ms-wma"/>
            <map from="wax" to="audio/x-ms-wax"/>
            <map from="wmv" to="video/x-ms-wmv"/>
            <map from="wvx" to="video/x-ms-wvx"/>
            <map from="wm" to="video/x-ms-wm"/>
            <map from="wmx" to="video/x-ms-wmx"/>
            <map from="m3u" to="audio/x-mpegurl"/>
            <map from="pls" to="audio/x-scpls"/>
            <map from="flv" to="video/x-flv"/>
            <map from="mkv" to="video/x-matroska"/>
            <map from="mka" to="audio/x-matroska"/>
            <map from="avi" to="video/divx"/>
            <map from="m2ts" to="video/avc"/>
            <map from="cr2" to="image/raw"/>
            <map from="nef" to="image/raw"/>
            <map from="raw" to="image/raw"/>
            <map from="CR2" to="image/raw"/>
            <map from="NEF" to="image/raw"/>
            <map from="RAW" to="image/raw"/>
          </extension-mimetype>
          <mimetype-upnpclass>
            <map from="audio/*" to="object.item.audioItem.musicTrack"/>
            <map from="video/*" to="object.item.videoItem"/>
            <map from="image/*" to="object.item.imageItem"/>
          </mimetype-upnpclass>
          <mimetype-contenttype>
            <treat mimetype="audio/mpeg" as="mp3"/>
            <treat mimetype="application/ogg" as="ogg"/>
            <treat mimetype="video/ogg" as="ogg"/>
            <treat mimetype="audio/ogg" as="ogg"/>
            <treat mimetype="audio/x-flac" as="flac"/>
            <treat mimetype="image/jpeg" as="jpg"/>
            <treat mimetype="audio/x-mpegurl" as="playlist"/>
            <treat mimetype="audio/x-scpls" as="playlist"/>
            <treat mimetype="audio/x-wav" as="pcm"/>
            <treat mimetype="audio/L16" as="pcm"/>
            <treat mimetype="video/x-msvideo" as="avi"/>
            <treat mimetype="video/mp4" as="mp4"/>
            <treat mimetype="audio/mp4" as="mp4"/>
            <treat mimetype="video/divx" as="avi"/>
            <treat mimetype="video/quicktime" as="mov"/>
            <treat mimetype="video/x-quicktime" as="mov"/>
          </mimetype-contenttype>
        </mappings>
        <online-content>
          <YouTube enabled="no" refresh="28800" update-at-start="no" purge-after="604800" racy-content="exclude" format="mp4" hd="no">
            <favorites user="mediatomb"/>
            <standardfeed feed="most_viewed" time-range="today"/>
            <playlists user="mediatomb"/>
            <uploads user="mediatomb"/>
            <standardfeed feed="recently_featured" time-range="today"/>
          </YouTube>
          <Weborama enabled="no" refresh="28800" update-at-start="no">
            <playlist name="Active" type="playlist" mood="active"/>
            <playlist name="Metal" type="playlist">
              <filter>
                <genres>metal</genres>
              </filter>
            </playlist>
          </Weborama>
          <AppleTrailers enabled="no" refresh="43200" update-at-start="no" resolution="640"/>
        </online-content>
      </import>
      <transcoding enabled="yes">
        <mimetype-profile-mappings>
          <transcode mimetype="application/ogg" using="audio2pcm"/>
          <transcode mimetype="application/ogg" using="video2jpeg"/>
          <transcode mimetype="audio/x-flac" using="audio2pcm"/>
          <transcode mimetype="video/x-flv" using="video2jpeg"/>
          <transcode mimetype="video/quicktime" using="video2jpeg"/>
          <transcode mimetype="video/x-flv" using="video2jpeg"/>
          <transcode mimetype="video/x-matroska" using="video2mpeg"/>
          <transcode mimetype="video/divx" using="video2jpeg"/>
          <transcode mimetype="video/x-ms-asf" using="video2jpeg"/>
          <transcode mimetype="video/x-ms-wmf" using="video2jpeg"/>
          <transcode mimetype="image/raw" using="raw2jpeg"/>
        </mimetype-profile-mappings>
        <profiles>
          <profile name="audio2pcm" enabled="yes" type="external">
            <mimetype>audio/L16</mimetype>
            <accept-url>yes</accept-url>
            <first-resource>yes</first-resource>
            <hide-original-resource>yes</hide-original-resource>
            <accept-ogg-theora>no</accept-ogg-theora>
            <sample-frequency>44100</sample-frequency>
            <audio-channels>2</audio-channels>
            <agent command="ffmpeg" arguments="-i %in -acodec pcm_s16be -ab 192k -ar 44100 -ac 2 -f s16be -y %out"/>
            <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
          </profile>
    <!--profile name="video2mpeg" enabled="yes" type="external">
            <mimetype>video/mpeg</mimetype>
            <accept-url>yes</accept-url>
            <first-resource>yes</first-resource>
            <hide-original-resource>yes</hide-original-resource>
            <accept-ogg-theora>yes</accept-ogg-theora>
            <agent command="/usr/local/bin/mediatomb-video2mpeg.sh" arguments="%in %out"/>
            <buffer size="10485760" chunk-size="262144" fill-size="524288"/>
          </profile-->
    <!-- Required for 0.11.0
          <profile name="video2jpeg" enabled="yes" type="external">
            <mimetype>image/jpeg</mimetype>
            <accept-url>no</accept-url>
            <thumbnail>yes</thumbnail>
            <resolution>160x160</resolution>
            <agent command="ffmpegthumbnailer" arguments="-i %in -o %out -s 160"/>
            <buffer size="524288" chunk-size="512" fill-size="1024"/>
          </profile>
    -->
          <profile name="video2mpeg" enabled="yes" type="external">
            <mimetype>video/mpeg</mimetype>
            <accept-url>yes</accept-url>
            <first-resource>yes</first-resource>
            <hide-original-resource>yes</hide-original-resource>
            <accept-ogg-theora>yes</accept-ogg-theora>
            <sample-frequency>48000</sample-frequency>
            <audio-channels>2</audio-channels>
            <agent command="ffmpeg" arguments="-i %in -vcodec mpeg2video -b 4096k -r 25 -acodec mp2 -ab 192k -ar 48000 -ac 2 -async 1 -f dvd -threads 2 -y %out"/>
            <buffer size="10485760" chunk-size="262144" fill-size="524288"/>
          </profile>
          <profile name="raw2jpeg" enabled="yes" type="external">
            <mimetype>image/jpeg</mimetype>
            <accept-url>no</accept-url>
            <first-resource>yes</first-resource>
            <hide-original-resource>yes</hide-original-resource>
            <agent command="/usr/local/bin/mediatomb-raw2jpeg.sh" arguments="%in %out"/>
            <buffer size="524288" chunk-size="512" fill-size="1024"/>
          </profile>
        </profiles>
      </transcoding>
    </config>
    
     
  • berky
    berky
    2012-09-30

    I realize this thread is old, but i'm having a similar but different issue.

    I have a "TV" directory that has sub-directories of each TV show. I set the TV directory to be scanned with 'recursion' turned on.

    under the 'database' -> 'video' directory, it lists it like the following:

    Video
    - TV
    --- TV show 1
    ---- S01E01.video
    ---- S01E02.video
    --- TV show 2
    ---- S01E01.video
    ---- S01E02.video
    ---- S02E01.video
    ---- S02E02.video
    --- TV show 3
    ---- S01E01.video
    ---- S01E02.video
    ---- S01E03.video

    etc…

    however, say I add a new episode (S02E03.video) to TV show 2's directory.
    When Mediatomb rescans, it now looks like this:

    Video
    - TV show 2
    --- S02E03.video
    - TV
    --- TV show 1
    ---- S01E01.video
    ---- S01E02.video
    --- TV show 2
    ---- S01E01.video
    ---- S01E02.video
    ---- S02E01.video
    ---- S02E02.video
    --- TV show 3
    ---- S01E01.video
    ---- S01E02.video

    If I delete the entire database and rescan it all in, they all show up under "TV", but the same thing happens again when adding a new episode.  I don't care if they all are their own directories under "video" or if they all show up under "TV".  I just want it to be consistent.  I didn't have this problem before, but it randomly started doing this a while ago… i've just been dealing with it, but it's really getting annoying.

    Anyone have any ideas?

     
  • berky
    berky
    2012-10-20

    So I switched to mysql and still have the same issue.  I also tried setting the scan to basic, with the same results.  So far I cannot find a solution to this.