This is a brain dump of the steps that I took to setup Mediatomb to (semi) dynamically publish a list of my mythtv recordings for playback on various media devices connected to my network.
The first select produces a list of each different TV series that Myth has recorded eg Mythbusters, Time Team, Dr Who, etc. For each of these series the second select produces a list of episodes currently on disk and numbers them sequentially in ascending date recorded order. This numbering is important later on in the import step as it gives Mediatomb a field to order its listings by.
A cron entry is set up to run this script each hour and to dump the output into "/tmp/mythdump.tsv". Note that the extension .tsv is very important as it will tell Mediatomb how to process the file.
In the extension-mimetype section add the following line.
<map from="tsv" to="text/tab-separated-values"/>
This tells Mediatomb to assign a mime type of "text/tab-separated-values" to all files that end with ".tsv". Next in the mime-contenttype section add the following line.
<treat mimetype="text/tab-separated-values" as="playlist"/>
This tells Mediatomp to treat all text/tab-separated-values files as playlists, not as regular files.
Finally modify getPlaylistType function in the comon.js file to return the connect value if a TSV file is being processed
Now all you need to do is to tell Mediatomb to watch the dump file (in this case /tmp/mythdump.tsv) for changes and it will automatically import the files into the structure for you. I've found that there is a bug in Mediatomb where immediately after you set up a watch the file is not imported. However if you regenerate the dump file after the watch is in place then everything works fine.