YAMJ on unRAID


Recommended Posts

Download

 

Recently I've been helping a customer get YAMJ running on an unRAID server for viewing on a Popcorn Hour C-200.  The result is very nice, so nice in fact, that I've replaced my own HTPC with a C-200!  So I thought it might be useful to the Community to provide a package of everything you need to install YAMJ.

 

Following is the readme.txt file:


This package contains everything you need to install YAMJ on an unRAID Server

 

Version history:

 0.1 - initial release

 

Package contents:

 MediaInfo CLI for Linux version 0.7.33

 Yet Another Movie Jukebox version 2.0 BETA release r1660

 JAVA 2 Runtime Environment (JRE) version 6.0 update 11.

 

 

Assumptions

 

1. Your movies are all under a single user share called "Movies" (arranged in subdirectories is ok).  If this is not the case, see section below, "Different Name of Movies Share".  Also, this share should be accessible via the Popcorn Hour (a.k.a., PCH) via SMB protocol.

 

2. Your server name is "Tower".  If this is not the case, you will need to edit the file My_Library.xml after step 3 below.

 

 

Procedure

 

1. Unzip the yamj_unraid.zip file to your PC and bring up your server's share list in a Network Places window.

 

2. Drag the 'extra' directory to the flash share.

 

3. Drag the 'YAMJ' directory to your Movies share.

 

4. If you have not modified your 'go' script, drag the 'go' file to the 'config' directory of the flash share, overwriting the existing 'go' file.  If you have made modifications to your 'go' script, then you will need to examine the 'go' file and add those changes to your 'go' script.

 

5. From the unRAID console or telnet session, type this command:

 

 /boot/extra/yamj-go

 

This command will install the run-time packages required for YAMJ (subsequently each time you reboot, you will not need to retype this command since it's invoked by the new 'go' script).  It will also create a command called 'yamj-rescan' which you can use to update the YAMJ media information after adding new content.

 

You are now ready to invoke 'yamj-rescan' for the first time.  Again, from the unRAID console or telnet session, type:

 

 yamj-rescan

 

This runs the YAMJ application by invoking /mnt/user/Movies/YAMJ/My_YAMJ.sh (a shell script).  Here's what will happen:

 

YAMJ will start scanning the Movies share for content (actually scans those directories specified in the My_Library.xml file - see below).

 

As it finds movies, it accesses the internet (mainly imdb.com, themoviedb.com, and thetvdb.com) to obtain metadata (movie details and artwork).

 

During this process it creates a directory called 'Jukebox' in the Movies share, and inside this directory is the generated metadata files, along with a number of html files which will comprise the YAMJ pages rendered by the PCH.  At the end of the process it will also generate an index.htm file in the Movies share which is the root of the jukebox.  The PCH has a feature, that if an 'index.htm' file exists in the root of a share, it's internal browser will render it instead of the usual flat file list - this is how the PCH can display the jukebox.

 

 

Design Notes and Tweaking

 

Because YAMJ scanning creates temporary files in the directory it's run from, you want it to reside on a hard disk, and not the Flash.  Also, you don't want the generated Jukebox directory to end up on the Flash either.  This is why you drag the YAMJ directory to the Movies share.

 

It's not strictly necessary to put the YAMJ directory in the Movies share; but, since the final Jukebox directory has to be in the Movies share, and the YAMJ creates temporary files in the YAMJ directory, and the drives need to be spun up to rescan the media, putting it in the Movies share is probably as good a place as any.

 

 

My_Library.xml and My_YAMJ.sh

 

These are files I created for YAMJ on unRAID, and are similar to those generated by Omertron's YAMJ_GUI_Config tool.

 

The My_Library.xml file contains xml-style descriptions of where YAMJ should look for media, and how the PCH will ultimately reference the media.  Here is the default contents of this file:

 

<libraries>

 <library>
   <path>/mnt/user/Movies</path>
   <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
   <exclude name="YAMJ/, Jukebox/"/>
   <description></description>
   <prebuf></prebuf>
   <scrapeLibrary>true</scrapeLibrary>
 </library>

</libraries>

 

Again, this assumes the name of your movies share is "Movies" and the name of your server is "Tower".  If either is different for your server, you must make appropriate changes in this file.  (I believe these names are case-insensitive.)  The 'exclude' string tells the scanner which directories and/or files to exclude from consideration.

 

It is also possible to have multiple entries in this file.  For example, suppose in your Movies folder you have several subdirectories:

 

  Movies/DVD
 Movies/Blu-ray
 Movies/Home-video
 Movies/Other
 Movies/YAMJ     <-- the YAMJ application
 Movies/Jukebox  <-- generated by 'yamj-rescan'

 

You probably only want the DVD and Blu-ray directories to get scanned.  In this case you could edit My_Library.xml to look like this:

 

<libraries>

 <library>
   <path>/mnt/user/Movies/Blu-ray</path>
   <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies/Blu-ray</playerpath>
   <exclude name=""/>
   <description></description>
   <prebuf></prebuf>
   <scrapeLibrary>true</scrapeLibrary>
 </library>

 <library>
   <path>/mnt/user/Movies/DVD</path>
   <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies/DVD</playerpath>
   <exclude name=""/>
   <description></description>
   <prebuf></prebuf>
   <scrapeLibrary>true</scrapeLibrary>
 </library>

</libraries>

 

Another way to do the same thing is this:

 

<libraries>

 <library>
   <path>/mnt/user/Movies</path>
   <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
   <exclude name="YAMJ/, Jukebox/, Home-video/, Other/"/>
   <description></description>
   <prebuf></prebuf>
   <scrapeLibrary>true</scrapeLibrary>
 </library>

</libraries>

 

My_YAMJ.sh

 

The My_YAMJ.sh script is used to invoke the YAMJ application and is set up to output the Jukebox directory and index.htm file to the Movies share.  Here is the default contents of this file:

 

#/bin/bash

# Include path to Java binary directory
PATH="$PATH:/usr/lib/java/bin"

# Change into YAMJ directory and execute the MovieJukebox script
# The -o option specifies where to put the generated index.htm and Jukebox directory.
cd /mnt/user/Movies/YAMJ ; ./MovieJukebox.sh My_Library.xml -o /mnt/user/Movies

 

The PATH statement is necessary so that the java binary is found when the MovieJukebox.sh script is executed.

 

What I want to point out here is the output (-o) option.  This is specifying where to put the generated index.htm file and Jukebox directory.  Instead of '/mnt/user/Movies' you could explicitly select the disk, e.g., change to '/mnt/disk1/Movies'.  Depending on how you have split-level set up, you might want to do this so that all output ends up on a single disk.

 

 

Different Name of Movies Share

 

If your movies share name is not "Movies" (e.g., maybe it's "Video"), I would recommend changing your share name to "Movies".  If you insist on not doing that, then you need to edit My_Libary.xml and My_YAMJ.sh appropriately.

 

 

Automating 'rescan'

 

It might be nice to put 'yamj-rescan' in a cron job.  This can be done by modifying your 'go' script to copy the 'yamj-rescan' command to the /etc/cron.daily directory for example.  I have found this to be unnecessary since it's easy enough to telnet into the server and manually execute the command when new content has been added.

 

 

Future Changes

 

In a future unRAID release, I will add the ability to define a RAM disk that can integrate with user shares.  With this feature, we can add a line to the 'yamj-rescan' script to move the Jukebox directory and index.htm file to the RAM disk.  This will let us browse the Jukebox via PCH without spinning up any drives.

 

Another change would be to generalize YAMJ installation somewhat so that you can have multiple Jukeboxes.  For example, as it's set up now, both movies and TV shows end up in the same Jukebox (and are accessed via the same share from the PCH point of view).  But it would be straight-forward to be able to have multiple shares:

  Movies
 TVShows
 HomeVideo
 OtherVideo 

 

Each of these shares could have it's own Jukebox & you would replace the PCH "home" page with a custom skin that let's you navigate to these shares separately.

 

Something else to point out... Suppose you have two separate shares, one called "DVD" and one called "BLURAY".  You might think you can edit My_Library.xml like this:

 

<libraries>

 <library>
   <path>/mnt/user/BLURAY</path>
   <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:BLURAY</playerpath>
   <exclude name=""/>
   <description></description>
   <prebuf></prebuf>
   <scrapeLibrary>true</scrapeLibrary>
 </library>

 <library>
   <path>/mnt/user/DVD</path>
   <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:DVD</playerpath>
   <exclude name=""/>
   <description></description>
   <prebuf></prebuf>
   <scrapeLibrary>true</scrapeLibrary>
 </library>

</libraries>

 

This will NOT work because of a PCH limitation where only one share can be mounted at a time.  When you navigate to the PCH 'Movies' share (in order to access index.htm), the PCH will have that share mounted internally.  When you try to play a movie, it would require the PCH to also have BLURAY or DVD mounted.  The result is that the move won't play.

 

 

Misc. YAMJ Notes

 

The forum over at networkedmediatank.com is a very good resource (obviously) for learning PCH and YAMJ, and customizing the skin.  What follows are some observations made during process of getting this working on unRAID.

 

- Skinning: If you want to change the skin, for most skins what you do is download the skin directory and then copy that directory to Movies/YAMJ/skins.  Next, find the file Movies/YAMJ/properties/moviejukebox.properties and copy it one level up (i.e., to Movies/YAMJ).  Now you can edit this file and set the name of the skin to use.  You will have to delete the Jukebox directory and recan all your media.  You will probably also want to edit some of the skin properties files.

 

- File naming: The scanner is pretty good at identifying movies from the file name.  There is documentation on what the file name convention should be to aide in this process (as well as correctly identify TV eipsodes) in the wiki section of the MovieJukebox code repository (code.google.com/p/moviejukebox/).  This is the biggest pain in the neck: going through your collection and renaming titles so the correct metadata is picked up.

 

- Wrong metadata: Sometimes even if the file name is correct, YAMJ will still pick up the wrong metadata (either movie details, the artwork, or both).  In this case there are a couple of approaches.  If only the artwork is messed up or missing, you can download your own and place it in the move title directory.  When YAMJ rescans, it will use this artwork instead of searching for it on the internet.  If the movie details are wrong, or you want to tweak them, you will need to create what's called an "NFO" file.  This is just an xml file (defined by the XBMC project) that describes the metadata.  Again, if YAMJ rescans and finds an NFO file, it will use data contained therein instead of obtaining via internet.  There are some PC-based tools you can download to create NFO files, for example Ember Media Manager (www.embermm.com/).

 

 

 

 

Link to comment
  • Replies 292
  • Created
  • Last Reply

Top Posters In This Topic

Thanks for building this. Very useful. I'd been meaning to get this running on my unRAID box, but never got round to it.

 

I found I needed to use "/boot/extra/yamj-rescan" as the command, as I wasn't usually in the correct directory.

 

Other than that, it seems to work well. I just had YAMJ scan all 372 Blu-ray movies on my server (16TB) in about an hour, and it built the Jukebox correctly.

 

I've just installed the Aeon Movie Wall skin and am re-scanning now.

Link to comment

Download

This will NOT work because of a PCH limitation where only one share can be mounted at a time.  When you navigate to the PCH 'Movies' share (in order to access index.htm), the PCH will have that share mounted internally.  When you try to play a movie, it would require the PCH to also have BLURAY or DVD mounted.  The result is that the move won't play.

 

To get round this limitation, I mount other shares within the Movies folder. In my case, I'm actually mounting other servers in the folder, not shares from the same server.

 

I added the following to my go script:

 

mount -o ro,nolock,tcp 192.168.0.16:/mnt/disk1/share/HD/Movies /mnt/disk1/Movies/LSLIVE
mount -o ro,nolock,tcp 192.168.0.16:/mnt/usbdisk1 /mnt/disk1/Movies/LSLIVE_usbdisk1

 

I then edited My_Library as follows:

 

<libraries>

  <library>
    <path>/mnt/user/Movies</path>
    <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
    <exclude name="YAMJ/, Jukebox/, LSLIVE/, LSLIVE_usbdisk1/"/>
    <description>Tower</description>
    <prebuf></prebuf>
    <scrapeLibrary>true</scrapeLibrary>
  </library>

  <library>
    <path>/mnt/user/Movies/LSLIVE</path>
    <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
    <exclude name="TV/"/>
    <description>LSLive</description>
    <prebuf></prebuf>
    <scrapeLibrary>true</scrapeLibrary>
  </library>

  <library>
    <path>/mnt/user/Movies/LSLIVE_usbdisk1</path>
    <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
    <exclude name="YAMJ/"/>
    <description>LSL_usbdisk1</description>
    <prebuf></prebuf>
    <scrapeLibrary>true</scrapeLibrary>
  </library>

</libraries>

 

I'm also going to set up YAMJ to scan the internal drives on my PCH C-200, but will change the playerpath attribute so that playback is still done locally on the PCH.

Link to comment

I added the following to my go script:

 

mount -o ro,nolock,tcp 192.168.0.16:/mnt/disk1/share/HD/Movies /mnt/disk1/Movies/LSLIVE
mount -o ro,nolock,tcp 192.168.0.16:/mnt/usbdisk1 /mnt/disk1/Movies/LSLIVE_usbdisk1

Just be aware that you'll need to perform those "mounts" after unRAID starts, so you'll need some delay in the "go" script to make sure /mnt/disk1 exists before performing the remote mount.

 

Something like this might work

emhttp &
for i in 1 2 3 4 5 6 7 8 9 10
do
   if [ -d /mnt/disk1 ]; then
      mount .....
      mount .....
      break;
   else
      sleep 10
   fi
done

It will try to perform the mount for 100 seconds.  It will exit the "go" script if it fails to perform the mount after that time... but then something is probably wrong with the server file-systems to prevent it from starting.

 

And even more important, if you attempt to stop the server it will not stop because /mnt/disk1 cannot be un-mounted because it is busy.  It will remain busy until you un-mount the two remote file-systems.  at that time, the unRAID server will be able to stop the array.  Currently unRAID has no "trigger events" to execute a script for un-mounting those remote file-systems before stopping the array.

 

Soon (hopefully) in unRAID 5.0, we will have "trigger events" where we can register the post-start "mount" commands and pre-stop "un-mount" commands to allow the server to start and stop with minimal manually typed commands.  We do not have those events now unless you "simulate them" with a monitoring script of your own.

 

Joe L.

Link to comment

Soon (hopefully) in unRAID 5.0, we will have "trigger events" where we can...

With some luck we'll get those events sooner than that, as Tom indicated in this post:

Probably will be a 4.5.5 to add a couple drivers and some misc fixes.  I can also throw in a few script call-outs as well.

 

Link to comment

Thanks Joe. L I will make the changes to my go script.

 

Can I mount the servers in /mnt/user/Movies? That would be better?

I've not tried that... but I know it does not exist until emhttp starts either.  don't know if it would keep /mnt/user from being un-mounted.  worth an experiment or two.

 

Perhaps mount the remote drives on /var/mnt/whatever

Then, use symbolic links in /mnt/disk1/Movies to link to them and change the option in SAMBA to follow the symbolic links by adding whatever is needed in /boot/config/smb-extra.conf

Link to comment

Scanning the library actually just generates a bunch of html files.  The popcorn hour renders the html the same way a browser would.  You can just open up 'index.html' in a browser and see what the skin will look like on the popcorn hour.  All the links should work the same way in a browser that they will work in a pch.

 

Chris

Link to comment

This looks interesting.  Is there any way to see the interface with a PC, I don't have a popcorn Hour?

 

Yes, you can drop the index.htm file in your firefox browser. You can't graphically navigate through all the sub files (depends also on the skin used; the best one is AEON) but take a look at the URL bar, there is logic behing the naming and use to specify them html files manually you want to go to.

 

All the links should work the same way in a browser that they will work in a pch.

 

They should but they don't work the same as on the C200 and there is reason behind that. Play also doesn't work, also some images are little off of wrong size so don't judge graphical appearance based on preview on a PC.

 

Link to comment

 

If you want to have directors and actors grouped and pages for their filmography generated, this is possible with AEON too. It's not a default option however, needs to be turned on in the property file for AEON.

 

Basically AEON is the most important and best developed extension to YAMJ, it is not a skin only.

Link to comment

Another question I'm having trouble finding the answer to.  I'm about 10% of the way through ripping my 1800 DVD's.  Each one is saved in it's own folder using the DVD structure (video_ts folder).  Can yamj use this? 

Link to comment

In a future unRAID release, I will add the ability to define a RAM disk that can integrate with user shares.  With this feature, we can add a line to the 'yamj-rescan' script to move the Jukebox directory and index.htm file to the RAM disk.  This will let us browse the Jukebox via PCH without spinning up any drives.

 

Great idea, just make it as big as RAM would allow.

 

What about putting now the generated Jukebox in /something/Jukebox directly in RAM? When unRAID boots it gets loaded in the background from an USB stick. The rescan script generates to the stick and then rsync or tar to /something/Jukebox

Link to comment

Thank you for your work.  I was just thinking that it would be nice to have some type of "service" (notice a windows user by default) for my unraid media files to create my .nfo files for xbmc.

 

Question:

 

I know with windows service you can select options for xbmc nfo files.  Can I do the same thing with this solution?  I don't have popcorn hour, but would like to use it for xbmc media library.

 

Link to comment

I'm using YANFOE to create the .NFO files (and link to the artwork for cover and fanart also) for my movies and YAMJ to scrape my TV shows from TVDB.

 

For me, it doesn't make any sense to let YAMJ do any scraping for the movies as I know the .NFO files are correct.  Setting the <scrapelibrary> section in the library.xml file to 'false' will disable the scraping for a particular library as below.

 

  <library>
    <path>/mnt/user/Share/movies</path>
    <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/tower/movies/</playerpath>
    <exclude name="sample,tmp/,temp/,RECYCLER/,RECYCLE.BIN/"/>
    <description>PCH</description>
    <prebuf></prebuf>
    <scrapeLibrary>false</scrapeLibrary>
  </library>

  <library>
    <path>/mnt/user/Share/tv</path>
    <playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/tower/tv/</playerpath>
    <exclude name="sample,tmp/,temp/,RECYCLER/,RECYCLE.BIN/"/>
    <description>PCH2</description>
    <prebuf></prebuf>
    <scrapeLibrary>true</scrapeLibrary>
  </library>

 

For the 1,500 movies on my first server (all YAMJ files [NFO, .JPG, .HTML etc] are stored on a single hard disk), this takes about two to three minutes (an amazing speedup compared to using YAMJ to index from a PC) to reindex and create new HTML files.

 

The main issue with the C-200 is that it will not (by default) allow two network shares to be mounted at the same time, so for the movies on my 2nd Unraid server, I create a second index on that server.  It's possible to work around the mounting issue, but actually I'm too lazy to figure it out at the moment :-)

 

Credit to the person (Starcat?) who created the original thread, and thanks for continuing the work Tom.

 

Cheers,

 

-jj-

Link to comment

The main issue with the C-200 is that it will not (by default) allow two network shares to be mounted at the same time, so for the movies on my 2nd Unraid server, I create a second index on that server.  It's possible to work around the mounting issue, but actually I'm too lazy to figure it out at the moment :-)

 

This is a no brainer. Just (NFS) mount the second server in the file system on the first and use a single mount on the C-200. It is as easy as this!

Link to comment

Yeah, I'm not sure but I think I know this neilt0 guy from another forum!  At least his avatar looks familiar :-)

 

Sorry to appear extremely dopey, but I'm not quite sure what would mean regarding the "NFS mount the second server", looking through the forum and WIKI, it seems that NFS is a different protocol to the SMB which I am using presently (yes I told you this post would appear to make me look extremely stupid!).  How exactly would I "merge" both servers into one link for the PCH?

 

Both servers are configured in the same way (ie, SMB and a movie and tv share name on each) currently.

 

As mentioned, I did scour the forum before asking, so some pointers would be appreciated :-)

 

Cheers,

 

-jj-

 

 

 

Link to comment

As both unraid boxes are linux based and NFS is the native protocol it just makes sense to use this between both. You may then use SMB to export the share from your main unraid box to the C200.

 

Do something like this on the main unraid box (unraid1) where share is the name for your media folder on unraid1 and share2 is the media folder on unraid2:

mkdir /mnt/user/share/unraid2

mount -t nfs unraid2-ip-address:/mnt/user/share2 /mnt/user/share/unraid2

 

then you would be able to see the unraid2 box down below the single /mnt/user/share and only this one needs to be mounted on the C200.

 

Link to comment

Yeah, I'm not sure but I think I know this neilt0 guy from another forum!  At least his avatar looks familiar :-)

 

Yeah, it's me...!

 

I would like a definitive set of instructions (from an expert like Tom or Joe L.) for mounting a remote share on an unRAID server to get over the limitation of the C-200 only handling a single share. We also need info on unmounting before unRAID shutdown.

 

I accidentally mounted a remote share as rw not ro and didn't unmount it, and that drive (EXT3) had all of its directories corrupted -- I couldn't read a single file.

Fortunately, I used R-Studio to recover the drive and all is well.

 

But, I'm not doing that again until I know what I'm doing.

 

Oh, and here are some slightly more up-to-date screenshots:

 

24y6cti.jpg

 

20ayjdh.jpg

 

107kz7r.jpg

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.