XBMC Standalone Library Updater for UnRAID


Recommended Posts

Current version 1.2

Based on 12.2 Frodo

Video database version: MyVideos75

Audio Database version: MyMusic32

See the following link for more information on which versions of XBMC use which database versions:

http://wiki.xbmc.org/index.php?title=XBMC_databases/Version_table

 

otjlp4.png

 

This work is based on KRavEN's post to compile and build a headless XBMC and Influencer's plug-ins for UnRAID. Their work can be found here:

 

http://forum.xbmc.org/showthread.php?tid=132919&pid=1262063#pid1262063

https://github.com/Influencer/UNplugged

 

A generic, simplified set of instructions can be found here:

http://bootlegninja.awardspace.com/xbmc-server/

 

I will only be maintaining this for the most current stable version. Should anyone want to fork this for a Gotham version or whatever, here are the complete instructions I used to compile this:

http://lime-technology.com/forum/index.php?topic=27545.msg276305#msg276305

 

XBMC SaLUd (Standalone Library Updater) is meant to do one thing and one thing only: update the XBMC MySQL shared library. Like many others, I use XBMC to watch a lot of my shows but do not keep my HTPC on 24/7 to receive library update notifications. In fact I do not even keep UnRAID on 24/7. So when I have new shows to watch, I often have to update the library first and wait for it to complete a scan to watch a show. This can be a very time consuming process, particularly on a Raspberry Pi. I have tried other solutions such as an auto-update library plug-in for XBMC but have had mixed result. I wanted something that could run on my UnRAID box alongside Sickbeard and SABnzbd. That way the XBMC library would be kept constantly up to date and healthy ("salud" means "health" in Spanish!) with notifications from programs such as Sickbeard. So I read up on using XBMC in a headless/server mode. It is still a work in progress but I was able to adapt others' work into a functioning package for Slackware, which UnRAID is based on. Then I wrapped it up nice and neat in a plug-in. It can be ran either as an-always-on daemon, waiting to receive library updates, or on demand, via script, cronjob, or the webUI.

 

INSTALLATION INSTRUCTIONS

 

Without database

If you already have a database, skip this section. If you do not already have a MySQL database setup with XBMC, follow these steps:

 

i. After you install the MySQL plugin, get into the MySQL command line utility by typing the following in a terminal/telnet session:

mysql -u root -p

 

ii. Enter the following commands, pressing enter after every line:

CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
GRANT ALL ON *.* TO 'xbmc';
\q

 

iii. You also may need to create the databases. If so, go back into the MySQL command line utility and type:

CREATE database MyVideos75;
CREATE database MyMusic32;

Don't forget to press enter after the semi-colons and /q to quit

 

iv. Make sure and create your advancedsettings.xml file:

http://wiki.xbmc.org/index.php?title=HOW-TO:Share_libraries_using_MySQL/Setting_up_XBMC

 

With database

 

1. Download the plugin

https://github.com/bobbintb/unRAID/raw/master/xbmcsalud.plg

 

2. Place it in "/config/plugins/" on you UnRAID flash drive

 

3. Reboot UnRAID or run this command from the terminal/telnet

installplg /boot/config/plugins/xbmcsalud.plg

 

4. Change the setting via the UnRAID webUI to your liking.

 

5. Copy:

sources.xml
advancedsettings.xml

from another XBMC installation on your network and place them in:

/boot/config/plugins/xbmcsalud

 

6. Make sure your advancedsettings.xml file is set to do updates in the background for any of your media libraries:

 

http://wiki.xbmc.org/?title=Advancedsettings.xml#.3Cmusiclibrary.3E

 

7. Setup any other programs to send notification to XBMC

 

NOTES (MUST READ!)

 

There are a few things you need to know about this plugin. This plug-in is not perfect, mainly because running XBMC headless is not perfect.

 

1. You need MySQL 5.5.30 to use this. Of course, you should know that if you are using a MySQL shared library with XBMC you will need MySQL. If there is no plugin found it will prompt you to install it. If you have MySQL installed but it is an older version, it will not prompt you to install it. Make sure you have the right version until I can get a chance to remedy this.

 

CREDITS (in no particular order)

Benni-Chan: Originally creating the plug-in that Influencer's is based from.

Influencer: For helping in creating and debugging this plugin, which is based on their own plug-ins (in turn, based on Benni-Chan's)

Kricker & CHBMB: For helping me test.

piotrasd: My project partner that does all the  heavy lifting in compiling test version and generally working that side of the project while I work the other.

dmacias: helping test and contributing code.

KRavEN: From the XBMC forum for providing a guide to follow in building a headless XBMC

 

Anyone else that provided help, such as those that provided the cpp files to make this compile, whoever you are, and others that tested and reported bugs.

 

Things to be done

1. Fix package issues. Plugin requires more than one version of the same library due to build environment issues. (Fixed in beta)

2. Add cron-job option

3. Add update on start option (see FAQ)

4. Remove need to add background update to advancedsettings.xml by placing it in guisettings.xml. (Fixed in beta)

5. Add self monitoring cronjob to restart after crash

 

Change Log

1.1 --> 1.2 - 7/6/13 - attempted fix for permissions issues common with language files

1.2 --> 1.3 - 12/19/13 - Added this patch to fix a segfault: http://forum.xbmc.org/showthread.php?tid=132919&pid=1565792#pid1565792

                                      Recompiled with the same version of python that Influencer's plugins use.

                                      Fixed need to require multiple versions of the same package

                                      Background update tag in advancedsettings.xml as it is now in guisettings.xml

                                      Removed pcre-8.32-i686-1PTr.txz. Pretty sure it isn't needed anymore.

 

 

FAQ:

 

1. How do I set XBMC SaLUd to update the library on startup?

In your advancedsettings.xml file in your plugins folder under the respective library tag add the following:

<updateonstartup>true</updateonstartup>

In other words if you want the video library to update on startup, place it between the video library tags:

    <videolibrary>
        <updateonstartup>true</updateonstartup>
    </videolibrary>

I may add this function to the webUI someday, but no promises.

 

2. How do I use add-on XXXX?

Many add-ons can just be copied and pasted from another XBMC directory. Although I have not tested it, the library auto-update add-on has been reported working by users.

 

3. How do I fix the "language file" error?

Some people get the following error and XBMC SaLUd will not start:

09:35:18 T:1118578560   FATAL: Create: Failed to load English language file, from path: special://xbmc/language/

This issue has happened to a few people and it is resolved by copying strings.xml and langinfo.xml files from a working XBMC installation. I don't know why those files don't get created as they should for some people. Fixing the permissions (chmod and chown) should fix the issue but people say it doesn't and I have never been able to recreate it.

 

4. Something else isn't working properly

Check here:

http://lime-technology.com/forum/index.php?topic=27545.msg309655#msg309655

Link to comment
  • Replies 640
  • Created
  • Last Reply

Top Posters In This Topic

Tried this but it doesn't seem to be updating my shows.  Sickbeard all set up, says the test connection is successful, tried both the actual IP address of my UnRAID server and 127.0.0.1 with :8088 of course, sickbeard log sends the JSON command but nothing seems to happen.

 

Anything I should look at?

Link to comment

Started to look a bit more into it, SAB stopped running the SABtoSickbeard script properly, tried rebooting my server but the webinterface never loaded so just removed the plugin for the moment to see what's going on.

 

Only thing I changed after installing your plugin was the notifications that sickbeard sends and the IP address it sends them to.

Link to comment

Started to look a bit more into it, SAB stopped running the SABtoSickbeard script properly, tried rebooting my server but the webinterface never loaded so just removed the plugin for the moment to see what's going on.

 

Only thing I changed after installing your plugin was the notifications that sickbeard sends and the IP address it sends them to.

 

i am seeing that as well now. i thought i had it working before but i think i made a false assumption. when i ran the test and the library updated, i failed to deavtivate the library watchdog because it never really works i often forget it is there. i can get the plugin to run a full library scan from sickbeard (although nothing is updated) but doing a scan on the show level errors the python script. sound like the same thing you are getting? ive been working on a recompile. we'll see it goes.

Link to comment

bobbintb,

 

Sorry I haven't been able to test anymore. I am heading of on vacation and ran out of time. When I get back I look forward to trying it out again and seeing what improvements may have been made. Best of luck!

 

no worries. enjoy your vacation.  ;)

Link to comment

A couple things I noticed. I have my xbmc sources setup as nfs shares which doesn't work.  It gives some nfslib error.  Which is fine cause I plan to switch back to smb.  And I noticed you used xbmcserver_video and xbmcserver_music in advancedsettings.xml.  When I installed mysql originally I let xbmc use the default db name of MyVideos and MyMusic.  That may mix some people up if they want to use their current db.  So I changed my sources.xml to smb and I let it create the xbmcserver db's in mysql but I couldnt get it to update the library.  I'm in the process of letting my mediacenter update the xbmcserver db's but I don't know if unraid can update them.  Similar to the other thread, I get crond segfaults every minute. I think they are related to glibc-2.13-i486-4.txz because if I remove that line from the plg file I dont get the segfaults.  But as soon as I install glibc-2.13-i486-4.txz I do. The server:8088 webpage works and I can see all my movies as my mediacenter is updating.  Looking forward to more, thanks.

Link to comment

right now im trying to figure out why the library wont scan. it will scan but here is the result im getting:

 

8:07:53 T:3013327728   DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}
18:07:53 T:3013327728   DEBUG: JSONRPC: Calling videolibrary.scan
18:07:53 T:2936748912  NOTICE: Thread CVideoInfoScanner start, auto delete: false
18:07:53 T:2936748912  NOTICE: VideoInfoScanner: Starting scan ..
18:07:53 T:2936748912   DEBUG: CAnnouncementManager - Announcement: OnScanStarted from xbmc
18:07:53 T:2936748912 WARNING: Create - Unsupported protocol(nfs) in nfs://192.168.1.2/mnt/user/ZERO/Movies/
18:07:53 T:2936748912   ERROR: Exists - Error checking for nfs://192.168.1.2/mnt/user/ZERO/Movies/
18:07:53 T:2936748912 WARNING: Process directory 'nfs://192.168.1.2/mnt/user/ZERO/Movies/' does not exist - skipping scan.
18:07:53 T:2936748912 WARNING: Create - Unsupported protocol(nfs) in nfs://192.168.1.2/mnt/user/ZERO/TV/
18:07:53 T:2936748912   ERROR: Exists - Error checking for nfs://192.168.1.2/mnt/user/ZERO/TV/
18:07:53 T:2936748912 WARNING: Process directory 'nfs://192.168.1.2/mnt/user/ZERO/TV/' does not exist - skipping scan.
18:07:53 T:2936748912 WARNING: Create - Unsupported protocol(nfs) in nfs://192.168.1.2/mnt/user/ZERO/TV/30 Rock/
18:07:53 T:2936748912   ERROR: Exists - Error checking for nfs://192.168.1.2/mnt/user/ZERO/TV/30 Rock/
18:07:53 T:2936748912 WARNING: Process directory 'nfs://192.168.1.2/mnt/user/ZERO/TV/30 Rock/' does not exist - skipping scan.

 

the program was compiled with nfs enabled and the nfs library is installed so im trying to figure out what the problem is. since this is for unraid, i think nfs support is a must.

Link to comment

Really excited about, ever since I saw the minimized version being built on XBMC I had hoped it would be possible to put this on unraid. Then you started to work on it and I have been following your work. I'll get around to installing it a little farther into the future (don't want to break my working WOL system/scripts atm) or on a new build I doing for someone else this week.

 

Question though, is it possible to install addons in this stripped down version of XBMC, say like the trakt.tv addon? Of course disabling all notifications, and not sure how easy it would be to install without a GUI (though I assume you would just copy a working install from a full XBMC version) Just curious...

Link to comment

Question though, is it possible to install addons in this stripped down version of XBMC, say like the trakt.tv addon? Of course disabling all notifications, and not sure how easy it would be to install without a GUI (though I assume you would just copy a working install from a full XBMC version) Just curious...

 

As long as the addon doesn't depend on anything that was removed it should work. I've seen posts about it but don't remember what it pertained. As far as installing the easiest way would be to just directly copy it from another XBMC on the network.

 

Out of curiosity, what is the biggest reason you use trakt? I never used it mainly because the only reason I would want it was so I can keep better track of the status of my shows when sickbeard upgrades the quality of an episode/file. But I have since found a better solution.

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.