Multiple Jukeboxes - YAMJ/yamj-v2 GitHub Wiki
YAMJ is not limited to generating a single jukebox, many power users generate several jukeboxes and configure those jukeboxes for their different user's needs using a single installation of YAMJ.
I will try and set out the most useful configuration options available in the properties and command line options that will enable you to create an installation that allows you to have as many jukeboxes as you require.
This is by no means an exhaustive or proscriptive way of doing things, simply one that I find most useful and hopefully others will to.
Firsty, we are going to consider the layout of your video files. If you are using HTML skins then you will probably want to keep the locations of your files on a single share (assuming your files are on a network drive), this restriction doesn't apply to Eversion which can mount the shares automatically for you. In this tuturial I am not concerned with the player paths, just the location of the files.
So, in this example we will have 2 file locations and create the jukeboxes from those locations:
- Movies
- TV_Shows These could be anything you like, I am not suggesting this segregation is by any means the right way to do it, just one example. Some people like to split their content by genre, certification, language, etc., all of those will work with this tutorial.
So, YAMJ needs to know several things to generate your jukebox:
- What is your library file called (default library.xml)
- Where are your files located (In the library.xml path)
- How does the player locate the files (In the library.xml player path - not covered here)
- Where do you want the jukebox stored
- What do you want the jukebox folder called (Default - Jukebox)
- What do you want the starting page called (Default - index.htm)
- What is your custom properties file called (Default - moviejukebox.properties)
Most of you will be familiar with the GUI Config that creates two files for you My_YAMJ.cmd
and My_Library.xml
, we'll use this principle and add a custom properties file to control the remainder of the properties.
Firstly, always backup your configuration and directories. One of the benefits of YAMJ is that it is self contained within it's own directory and does not need to be "installed" in any specific location, so backing up your installation is as simple as compressing the YAMJ folder into an archive file (Zip/Rar/etc.).
So, we need to configure these three types of files:
- Command file (.CMD) / Shell script (.sh)
- Library file
- Properties file
Although you technically don't need the command file, it makes running things easier! So we'll configure the command file to use the library file and properties file to generate the jukebox into the correct folder and name it correctly.
You can place all of these files anywhere you like really, but to keep things simple we'll create a sub-directory in the YAMJ folder and place them all in there. Editing the files and changing the paths will require some knowledge of relative paths and understanding where you files are located for your particular setup.
Firsly, we'll create the library file for the Movies, this will look like this
<libraries>
<library>
<path>//NAS/Videos/Movies/</path>
<playerpath>smb://NAS/videos/Movies/</playerpath>
<description>Movies</description>
</library>
</libraries>
Again, doesn't matter about the paths here, just that we have a library file called movies_library.xml
Next we need to create a properties file called movies.properties
We'll use several properties in this file to control where the jukebox is to be created and stored.
- mjb.jukeboxRoot - Contains the location where the jukebox folder and index file will be created
- mjb.detailsDirName - Is the name of the jukebox folder (usually Jukebox)
- mjb.indexFile - Is the name of the index file (usually index.htm)
You can add the rest of the properties in this file as well (treat it the same as moviejukebox.properties
), so put your mjb.skin.dir
in here as well.
We are going to configure it so that our jukeboxes are all in the same folder, at the same level:
\\NAS\YAMJ\
+ Movies\..files..
+ TV_Shows\..files..
+ movies.htm
+ tvshows.htm
So the movies.properties
file will look like this:
mjb.jukeboxRoot=//NAS/YAMJ/
mjb.detailsDirName=Movies
mjb.indexFile=movies.htm
Next up is the command file. Remember, if you are planning to run the file anywhere other than the current directory (perhaps from a shortcut on your desktop), it's good practice to add some CD commands to the file to ensure you start from a known location in the file.
movies.cmd
call ..\MovieJukebox movies_library.xml -p movies.properties
movies.sh
../moviejukebox.sh movies_library.xml -p movies.properties
the Command Syntax parameter tells YAMJ to override the default moviejukebox.properties
file with the one specified.
That's it. Simple really!
For completeness sake, the TV files are:
tv_library.xml
<libraries>
<library>
<path>//NAS/Videos/TV_Shows/</path>
<playerpath>smb://NAS/videos/TV_Shows/</playerpath>
<description>TV Shows</description>
</library>
</libraries>
tv.properties
mjb.jukeboxRoot=//NAS/YAMJ/
mjb.detailsDirName=TV_Shows
mjb.indexFile=tvshows.htm
tv.cmd
call ..\MovieJukebox tv_library.xml -p tv.properties
tv.sh
../moviejukebox.sh tv_library.xml -p tv.properties