Categories
Tags
apple codex comcast fail fbx gears of war 2 gentoo gitphp got root guitar hero gwu imac interview iphone iphone 3g linksys linux mantis mdb memcached mp3 new york comic con nightwatchman onenightdrunksongwritingexperiment pysoulforge red ring of death resume router school smarty soulforge tom morello towel trick windows work xbox 360 xxcache-
Recent Posts

MDB
MDB (Media DataBase) is just a little php webapp I wrote to keep track of the copious amounts of anime I have stored on my fileserver. It’s designed for easy browsing – as opposed to having a big conglomeration of files and folders that people have to sort through, it’ll index all the files and categorize them and sort the titles alphabetically. There’s other features such as searching. In addition to indexing the filenames, it also indexes filesizes, so it can calculate the size of your entire collection on the fly as well as print the size of each file and title (as long as your database is updated). Mine as of right now is 1.95 TB
There are user roles too – anonymous users can only browse the list of files. Normal (level 0) users can download the files too. Privileged (level 1) users can download as well as maintain the database – telling it to update its file list, perform integrity checks to make sure all the files are mapped, etc.
Other nifty features include search string highlighting, and an AJAX updater page – it will query the server once a second to see if the updatedb script is running – while it’s going, it’ll show an animated “…” ellipses, and will print “Database update completed” when the update is done. If the browser doesn’t support AJAX it’ll just print “Database updating” and stay that way. Fortunately it has checks to ensure database atomicity; that is, it won’t let you run more than one instance of the database update script to protect against commit collisions.
It uses ADOdb for the database connections, Smarty for the template display, and Mootools for the sidebar menu effects.
After installing those things, it’s easy to install mdb, just extract the tarball and create the database structure using the included SQL file. You’ll need to set up config/mdb.conf.php with your database connection options as well as file paths. It might be a little hard to grasp, so I’ll explain it here.
My anime filesystem structure looks kind of like this:
/storage
/storage/anime1
/storage/anime1/cowboy bebop/*.{avi,mkv,mp4}
/storage/anime1/full metal panic/01 – original/*.mkv
/storage/anime1/full metal panic/02 – fumoffu/*.mkv
/storage/anime1/full metal panic/03 – the second raid/*.mkv
/storage/anime2
/storage/anime2/love hina/tv/*.{avi,mkv,mp4}
/storage/anime2/love hina/manga/*.zip
/storage/anime3
/storage/anime3/suzumiya haruhi no yuutsu/afk/*.avi
/storage/anime3/suzumiya haruhi no yuutsu/animanda/*.avi
/storage/non-anime/*
/storage/incoming/*
You get the idea.
anime1, anime2, and anime3 are three raids. These are the ones that I want to index. “non-anime” is obviously non-anime stuff and “incoming” is the folder where I put incoming downloads. I want to index the 3 anime raids but I don’t want to index the incoming/non-anime directories (this is purely an anime list).
The root directory is specified as “/storage/”:
$mdb_conf['root'] = "/storage/";
The files I want to exclude are “incoming” and “non-anime”:
$mdb_conf['excludes'] = array(
"non-anime",
"incoming",
);
The title base is the list of files in which titles are. So on my filesystem, all the titles are under anime1, anime2, and anime3. Everything deeper than that is just a file stored under its respective directory. So in these examples, “full metal panic” would be recognized as a title since it’s right under anime1, but its subdirectories “01 – original”, “02 – fumoffu”, and “03 – the second raid” just have their contents categorized under the “full metal panic” title listing. Therefore, the titlebase set is:
$mdb_conf['titlebase'] = array(
"anime1",
"anime2",
"anime3",
);
I hope that’s enough of an explanation. If not, ask me.
You’ll find those configuration options in the mdb.conf.php as well as the database connection, smarty paths, adodb caching, etc. After doing that, you need to update the database as a privileged user that can do it through the web interface.
Changelog
Download
Older versions