automatic creation of virtual genres for your videowall



This script will rummage through a videowall compatible video collection and read the available video information.
Supported collection organizers:

DVD Profiler
movie.nfo - ???

From the available information it will list the Genres, TOP-250 Rank, Name, A-Z, Decade, and Rating (others being added).
It will then use symlinks to create:
- a semi-virtual heirarchy of Genres suitable for the videowall.
- TOP-250 directory with the video folders renamed in order of TOP-250 Rank
- Rating Folders 0-10
- Decade Folders 1920, 2010, etc
- A-Z Folders, A-B C-D, etc
- Name - a folder of all movies by name (if your collection's folders don't sort by name already)c
- videowall shortcuts for the new hierarchies.
- folder.jpg for all genres and videowall shortcuts

Discussion about this script takes place on the mede8er forum Automatic Genre Hierarchy Creator
*** WARNING ***
This is not a tool for beginners. Only persons experienced with the videowall and linux should be using this script.

Please be very careful deleting any of the folders and symlinks created by this script!
It is VERY easy to accidentally delete important files and folders that are the targets of symlinks, instead of the symlinks themselves.
-Contents of symlinked directories are your actual files -they are real so don't delete them.
-Double or triple check the command files this script produces before running them:
 clist.genre, clist.top250, clist.* - copy and paste a couple of command lines to test them out.
-Consider hosting your collection on a readonly filesystem.
-Always be absolutely certain which directory you are in when deleting files.
-Experiment before deleting large amounts of folders and symlinks.
-Ensure your filesystem supports symbolic links and doesn't silently fall back to hard links.
*** WARNING ***

Your movies can be on pretty much anything that the player will "mount" into the file system:
usb stick, sd card, network, local hard drive
the filesystems on those can be anything.. ntfs, fat32, ext3

The Genre directory (full of symlinks to those movie directories) has to be able to store symlinks:
-a filesystem mounted by the player (excluding any network shares)
ext3 partition (or equivalent- fat32 & ntfs do not work)

Users of mede8er and perhaps others will have an empty ext3 filesystem ready to go:
/tmp/hdd/root (160 megs)
(this is mentioned in the config file explanation later on)

Also, should go without saying, but far as I know accessing a symbolic link will not cause a network share to be mounted. 
You have to have your media mounted before access through a symbolic link will work.
If you don't know what 'mounted' means, find someone to help you before you accidentally wipe out your collection.
If you don't know any nerds, just ask anyone with a penguin on their shirt, or anyone with a bumper sticker that mentions "".


medelamer.tar (This shell script is licensed as GNU GPLv3)

This tar file contains the shell script and sample configuration file
Be certain that you retain the tabs and capitalization of the file contents.
Don't let anything convert these files from unix to pc (cr to cr-lf) or else it won't run.

The sample config file uses the excellent icon set GlynRS2 icons V2 (see bottom of 1st post for download link)
See the config file to find out where it expects this icon set to be located.
Hopefully I can soon have the set available for download here and it will match the default configuration file.


untar/copy to any writable directory on your media player

mark the script executable: chmod +x medelamer

edit the config file: vi medelamer.conf

Scan the config file carefully for any path names you need to change. I doubt you will have to change too much to get it going.
I do caution that it is configured to overwrite the videowall's shortcuts, so if you have any desire to keep your current shortcuts, change these file names in the configuration file now.
If you're just starting out, I suggest you change as little as necessary.

Make sure the partitions you will be writing to are mounted read-write.

It should go without saying but the partition hosting the symlinks must support symlinks. This excludes NTFS, FAT32, and network shares.
What you need to do is have an ext3 partition as the base for these videowall symbolic links. The symlinks can of course point to NTFS, FAT32, and network shares, so there's no need to move your media collection.

(NTFS can support directory junctions, but they don't work in the standard ntfs driver, and have other serious limitations, not to mention the ntfs driver's affinity for file/directory corruption)

Here's an explanation of the config file entries you will need to change before you run this script: This information is a little out of date as of rev4. Always review the config file for a new version. Most often it's just some new parameters or minor changes to old parameters.

COLLECTION SDM400 /tmp/hdd/volumes/HDD1/Movies/
This is the path to your movies that we are going to snoop thru and make symlinks to.
This is expected to be a folder that is already compatible with the videowall.

As of rev4, you may use this magic value instead of a path: USE_FIRST_SHORTCUT
It will scan your existing videowall shortcuts and use the first. 
(the first *working* shortcut to be more exact)
The script will skip over its own shortcuts.

example: -your collection would have a path like this:
/tmp/hdd/volumes/HDD1/Movies/Mooon (2009)/Mooon (2009) xxx unrated edition.cd1.mpg
/tmp/hdd/volumes/HDD1/Movies/Moolan (1998)/Moolan (1998).mpg

CAT_ROOT SEAN_DNF /tmp/hdd/volumes/HDD1/
Folder where the new genre and top250 categories will be created.

this will create:

/tmp/hdd/volumes/HDD1/Genre/Goatnorp/Moolan (1998) -> /tmp/hdd/volumes/HDD1/Movies/Moolan (1998)

If you are going to use the default ext3 partition, you want these created in /tmp/hdd/root/

mkdir /tmp/hdd/root/FAKES:

substitute the word "fakes" with anything you prefer, but keep the colon -its important to the videowall,
the videowall uses the path to the right of the colon as the root path on the screen and in its shortcuts

You can add videowall shortcuts yourself or configure the script to make them for you.
The will not duplicate or change one of its own shortcuts. Delete it beforehand if you want it recreated.

If you don't want the script to make any videowall shortcuts, change

Note that it will not copy any icon files to the videowall resource folder if disabled.

VW_ICON_DEST DNF /tmp/hdd/volumes/HDD1/videowall/
This folder is the one where the custom icons for videowall shortcuts need to be. The script will copy those icons in here for you.

This is between you and your videowall... I can't guess where your stuff is.

ICON_SRC DNF /tmp/hdd/volumes/HDD1/Resource/icon_libs/
This is the root folder where you have unzipped the excellent GlynRS2 icons rar file (or any other icon sets).

These other two options (further down in the conf file) get appended to this base path:

CAT	PATH	GlynRS2 genre icons for Mede8er videowall/GlynRS2 icons V2

(icons for the videowall shortcuts and folder.jpg's)

GENRE_SET	PATH	GlynRS2 genre icons for Mede8er videowall/GlynRS2 icons V2
RATING_SET	PATH	moviejukebox_v2.3/pictures

(icons for the Genre & Rating folder.jpg's)

/tmp/hdd/volumes/HDD1/Resource/icon_libs/GlynRS2 genre icons for Mede8er videowall/GlynRS2 icons V2/Documentaries.png

VW_LINKS /usr/local/etc/dvdplayer/JukeBoxPathL1.dat
# This file contains the ordered list of moviewall shortcuts.
# Set this to some other value if you have existing shortcuts you don't want erased!

example file contents:

VW_ICONS /usr/local/etc/dvdplayer/GenreList.dat
# The file that contains the ordered list of moviewall shortcuts' icons
# custom icons are supposed to be in VW_ICON_DEST (/videowall)
# Set this to some other value if you have existing shortcuts you don't want erased!

example file contents

VW_LINK_PREFIX /tmp/ramfs/volumes/SYSTEM:/
This is the videowall shortcut's prefix that will be used when writing shortcuts into the file.
Files on the internal hdd have the SYSTEM: path.
I can't tell you what your path is for shortcuts to other filesystems.
-Make a shortcut to it in the videowall then go look at this file and see what it wrote.

In the case where you're using /tmp/hdd/root, you might want this to match the CAT_ROOT above.

CAT_ROOT JIMS_FAKES_ROOT /tmp/hdd/root/FAKES:/ then:
VW_LINK_PREFIX /tmp/hdd/root/FAKES:/ I hadn't planned on having my source media and genre directories in different places. This isn't a big deal... you just have to make the shortcuts yourself if you don't like the shortcuts the script has created.

LOG_INFO /tmp/hdd/volumes/HDD1/opt/medelamer/medelamer.log
LOG_ERRORS /tmp/hdd/volumes/HDD1/opt/medelamer/medelamer.err
I'm not sure the script creates these yet. Put them wherever you like.
Some day they will help someone to identify bad xml files and stuff the script can't parse.

I think that's about it for the basics.


To run the script just type this: (in the program directory)


(optional) you may specify a config file: ./medelamer /etc/crap/joes_config

Have a look at all the files it creates. In particular, these are the command files it creates (configurable):


If you are satisfied that the commands in these files are okay, you can uncomment the last 3 lines in the script to execute them automatically.

#. "./$LIST_GENRE_CMDS" #. "./$LIST_TOP250_CMDS" #. "./$LIST_CAT_CMDS"
remove the hash mark #


This script hase been tested with a variety off long file and directory names with odd punctuation and spaces. It appears to function correctly but if you discover any such issues please let me know.
This ash script was developed on BusyBox v1.1.3.

Version History:

5th release, *artist-director, *formats (hd, sd, etc suggestions needed), *other categories mentioned in conf file
60-40 chance of ever being released :)

4th release, *new categories: A-Z, Decade, Name, *movie.nfo (xml) support, *automatic first-shortcut collection, *shortcut enable/disable, *config file tweaks, *quieter

3rd release, *ratings, *thumbgen xml support, *conf tweaks, *code tweaks

2nd release 1st release, *top250, *config file tweaks

1st release never released

Created 02 May 2011

Copyright © 2011 By Sean McLaughlin All Rights Reserved. The shell script is licensed as GNU GPLv3
Email: //End of File