Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XBMC Standalone Library Updater for UnRAID

Featured Replies

  • Replies 640
  • Views 166.1k
  • Created
  • Last Reply

Hey there,

 

this is the advancedsettings file I am using on my windows PC running XBMC to test:

 

<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>192.168.1.16</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
<name>xbmc_video</name>
</videodatabase>

<musicdatabase>
<type>mysql</type>
<host>192.168.1.16</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
<name>xbmc_music</name>
</musicdatabase>
</advancedsettings>

 

Hi Bobb, i'm not too sure what in that thread you are referring to but I tried this one:

 

mysqladmin flush-hosts -u root -p

 

After which I can access the database again using Heidi SQL but as soon as I start XBMC it seems to make too many invalid connections and then it is blocked again.

 

I tried to do this:

Open my.cnf (Linux) and change max_connect_errors variable to a large number.

max_connect_errors= 1000000

 

but the mysql data folder on my cache drive does not open over the network share, perhaps due to being in use or a permissions error.

 

  • Author

it looks like either HeidiSQL or xbmc is sending too many connections and making mysql lock up. did you check with HeidiSQL right after flushing? if so don't. try flushing it again and checking with XBMC. my guess is it is HeidiSQL for the same reason as the second answer on that link i sent. if your data folder is locked chown and chmod it in a terminal and you should be able to change it.

it looks like either HeidiSQL or xbmc is sending too many connections and making mysql lock up. did you check with HeidiSQL right after flushing? if so don't. try flushing it again and checking with XBMC. my guess is it is HeidiSQL for the same reason as the second answer on that link i sent. if your data folder is locked chown and chmod it in a terminal and you should be able to change it.

 

Thanks for your response, here is more info.

 

I can use heidi sql immediately after running the flush hosts command, then i can disconnect, and connect again, no problem, only when xbmc is run, i cannot connect thereafter with heidi.

 

I've tried to go closer to the source and try to configure the xbmcsalud plugin properly by inspecting the log of xbmcsalud. Please see attached log file. I have noticed the following lines of interest:

09:28:25 T:1118552688 ERROR: Unable to open database: xbmc_video6 [1049](Unknown database 'xbmc_video6')
09:28:25 T:1118552688 ERROR: Unable to open database: xbmc_video5 [1049](Unknown database 'xbmc_video5')
09:28:25 T:1118552688 ERROR: Unable to open database: xbmc_video4 [1049](Unknown database 'xbmc_video4')
09:28:25 T:1118552688 ERROR: Unable to open database: xbmc_video3 [1049](Unknown database 'xbmc_video3')
09:28:25 T:1118552688 ERROR: Unable to open database: xbmc_video2 [1049](Unknown database 'xbmc_video2')
09:28:25 T:1118552688 ERROR: Unable to open database: xbmc_video1 [1049](Unknown database 'xbmc_video1')
09:28:25 T:1118552688 NOTICE: Old database found - updating from version 0 to 75
09:28:25 T:1118552688 ERROR: SQL: The source database was unexpectedly empty.
09:28:25 T:1118552688 ERROR: Unable to copy old database xbmc_video to new version xbmc_video75
09:28:25 T:1118552688 NOTICE: Running database version TV22

 

xbmcsalud_log.txt

  • Author

pretty sure it's not an xbmc issue. it is a mysql issue.

those errors are because it cannot access the current version of the database, so it assumes you must have an older version and tries connecting over and over, each time trying an older version. this is all because there is an issue with mysql receiving too many connection requests and as a security precaution, cuts off access to it. it may be xbmc causing too many requests but i doubt it. anyway, try editing that files to allow more requests and see what that does.

kinda of related i think. notifications from sickbeard work great. i'm having issues getting my movie script to work. it works fine on xbmc for windows and openelec on both a rpi and a htpc.

 

#!/bin/bash
echo "curl -s -H \"Content-Type: application/json\" -u xbmc:xbmc -X POST -d '{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"params\":{\"directory\":\"smb://tower/x264/rls/\"}, \"id\": \"scan\"}' http://tower:9091/jsonrpc" | sed 's_rls_'"$3"'_g' | sh

 

just a fairly simple json request but xbmc salud is returning the following:

 

19:34:22 T:3005049712 DEBUG: webserver: request received for /jsonrpc

19:34:22 T:3005049712 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"JSONRPC.Version","id":1}

19:34:22 T:3005049712 DEBUG: JSONRPC: Calling jsonrpc.version

19:34:22 T:3005049712 DEBUG: webserver: request received for /jsonrpc

19:34:22 T:3005049712 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","id":1}

19:34:22 T:3005049712 DEBUG: JSONRPC: Calling videolibrary.gettvshows

19:34:22 T:3005049712 DEBUG: RunQuery took 190 ms for 140 items query: SELECT * FROM tvshowview

19:54:31 T:3005049712 DEBUG: webserver: request received for /jsonrpc

19:54:31 T:3005049712 DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "VideoLibrary.Scan", "params":{"directory":"smb://tower/x264/The.Conjuring.2013.1080p.BluRay.x264-ALLiANCE/"}, "id": "scan"}

19:54:31 T:3005049712 DEBUG: JSONRPC: Calling videolibrary.scan

19:54:31 T:3021826928 NOTICE: Thread CVideoInfoScanner start, auto delete: false

19:54:31 T:3021826928 NOTICE: VideoInfoScanner: Starting scan ..

19:54:31 T:3021826928 DEBUG: CAnnouncementManager - Announcement: OnScanStarted from xbmc

19:54:31 T:3021826928 NOTICE: CleanDatabase: Starting videodatabase cleanup ..

19:54:31 T:3021826928 DEBUG: CAnnouncementManager - Announcement: OnCleanStarted from xbmc

19:54:31 T:3021826928 DEBUG: Mysql Start transaction

19:54:31 T:3021826928 DEBUG: Mysql rollback transaction

19:54:31 T:3021826928 DEBUG: CAnnouncementManager - Announcement: OnCleanFinished from xbmc

19:54:31 T:3021826928 NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:00

19:54:31 T:3021826928 DEBUG: CAnnouncementManager - Announcement: OnScanFinished from xbmc

19:54:31 T:3021826928 DEBUG: Thread CVideoInfoScanner 3021826928 terminating

19:56:08 T:3033655056 NOTICE: Samba is idle. Closing the remaining connections

 

anyone help in decyphering this? it looks like it doesn't know that it's a movie and is tring to add to TV database? how do i 'set content' or change scrapers in a headless xbmc install like this? can i?

  • Author

not sure about the json request. i dont really have any experience with it other than skimming the xbmc wiki. as far as changing scrapers and content. that can all be done in the xml files. the content should be in sources.xml. not positive about the scraper though. guisettings maybe? if you find it let me know.

I just figured out how my n00b mistake, and let other learn from it;

XBMC saves the scrapper settings in the db. since my DB was empty, it assumed no files were needed to be screapped. After I configured the content type and scrapper through the XBMC GUI on another machine, now XBMC server (on UNRAID) can run the scan.

 

Looks like I'm good to go :)

 

@natiz,

 

which db file did you move over from another machine? i don't see anywhere that scrapers/content type is saved in any of the xml's.

pretty sure it's not an xbmc issue. it is a mysql issue.

those errors are because it cannot access the current version of the database, so it assumes you must have an older version and tries connecting over and over, each time trying an older version. this is all because there is an issue with mysql receiving too many connection requests and as a security precaution, cuts off access to it. it may be xbmc causing too many requests but i doubt it. anyway, try editing that files to allow more requests and see what that does.

 

Hi umm, I can't find the location of my.cnf in order to do this:

 

Flush all hosts in MySQL using mysqladmin:
mysqladmin flush-hosts -u root -p
Open my.cnf (Linux) or my.ini (Windows) and change max_connect_errors variable to a large number. I used:
max_connect_errors= 1000000

 

As far as I know it should be here as specified in "\\TOWER\flash\config\plugins\mysql\mysql.cfg"

#mysql configuration
SERVICE="disable"
DATADIR="/mnt/cache/userdata/mysql"

 

But I can't even access

/mnt/cache/userdata/mysql

 

over the network, it just says permission denied (even though the service is stopped). Also I tried to telnet into the tower and peruse the folder to see if i I could find my.cnf but to no avail. Any help? :<

 

 

 

pretty sure it's not an xbmc issue. it is a mysql issue.

those errors are because it cannot access the current version of the database, so it assumes you must have an older version and tries connecting over and over, each time trying an older version. this is all because there is an issue with mysql receiving too many connection requests and as a security precaution, cuts off access to it. it may be xbmc causing too many requests but i doubt it. anyway, try editing that files to allow more requests and see what that does.

 

Hi umm, I can't find the location of my.cnf in order to do this:

 

Flush all hosts in MySQL using mysqladmin:
mysqladmin flush-hosts -u root -p
Open my.cnf (Linux) or my.ini (Windows) and change max_connect_errors variable to a large number. I used:
max_connect_errors= 1000000

 

As far as I know it should be here as specified in "\\TOWER\flash\config\plugins\mysql\mysql.cfg"

#mysql configuration
SERVICE="disable"
DATADIR="/mnt/cache/userdata/mysql"

 

But I can't even access

/mnt/cache/userdata/mysql

 

over the network, it just says permission denied (even though the service is stopped). Also I tried to telnet into the tower and peruse the folder to see if i I could find my.cnf but to no avail. Any help? :<

 

FIXED! What I did was to DROP my databases that I had created manually, this is apparently an unnecessary step in the later versions of XBMC. THEN I changed my Advancedsettings.xml file to this:

<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>localhost</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>

<musicdatabase>
<type>mysql</type>
<host>localhost</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</musicdatabase>
</advancedsettings>

 

Notice that I have removed the database name variable from the advanced settings file completely, I just granted all permissions to the user xbmc and then restarted XBMCSalud which prompted it to create the databases it needed on its own. From there It seemed the database problem was taken care of but the library didn't update (it was saying update completed in 0:00). What I did here as mentioned previously in this thread was just to connect to the database from my windows PC with XBMC using the same advancedsettings file I had on unraid (only the host changed to that of the tower instead of localhost), then ran xbmc on my windows box, set content on my sources and away it went! I just stopped the library update on my windows box and went back to xbmcsalud to run a full update there.

 

Thanks for the support thus far, and thank you for this plugin, really neat.

 

  • Author

Good, glad you got it all sorted out.  :)

I was just thinking, it would be great if there was a way to schedule Library cleanups.  I'm sure this is something other Sickbeard users would find useful, if they also use the auto upgrade option.  When my shows get upgraded from HDTV to Web-DL, I wind up with duplicate entries in xbmc.  A simple schedule would help resolve this.

 

Thoughts?

I was just thinking, it would be great if there was a way to schedule Library cleanups.  I'm sure this is something other Sickbeard users would find useful, if they also use the auto upgrade option.  When my shows get upgraded from HDTV to Web-DL, I wind up with duplicate entries in xbmc.  A simple schedule would help resolve this.

 

Thoughts?

 

No problem, just use cron. For example this would clean the library twice a day at 8:03 and 16:03

3 8,16 * * * /etc/rc.d/rc.xbmcsalud videoclean

 

If you want it automatically added on boot you can add this to your go file:

 

#XBMC SCANNER

cat <(crontab -l) <(3 8,16 * * * /etc/rc.d/rc.xbmcsalud videoclean > /dev/null 2>&1) | crontab -

  • Author

I was just thinking, it would be great if there was a way to schedule Library cleanups.  I'm sure this is something other Sickbeard users would find useful, if they also use the auto upgrade option.  When my shows get upgraded from HDTV to Web-DL, I wind up with duplicate entries in xbmc.  A simple schedule would help resolve this.

 

Thoughts?

 

you know there is actually an addon for xbmc to do just that. it is on the list to add it by default. somebody a few pages back added it to their setup but i havent had time yet. however i think you might find that it wont solve your issue entirely. at least it didnt for me. i had the exact same problem but even after cleaning the library i would end up with a new entry because there is no real way for sickbeard to know that those two files are the exact same show and episode. what would happen is i would watch a show as it aired and then when it was released on bluray it would be upgraded. but since they were new files, my "recently added" list of shows would be cluttered with a whole season of something i already saw.

 

so what i ended up doing was making a tweak to sickbeard. sickbeard has the ability to run custom scripts after processing. it will pass along information about the tv show that was processed to the custom script. in the case of a file being replaced/upgraded it wont, however, pass along the name of the file being replaced. so i modified it slightly to include the name of the file that is being replaced. then i wrote a script so that if a file is being upgraded, it will search the xbmc database for the old file and change the record with the new information.

 

so essentially instead of adding the new file to the database and deleting the old one, it will now simply modify the old one to match the new one and keep all the other attributes that would be lost otherwise. it is a much more elegant solution. i submitted a pull request for this tweak but i doubt it will get pulled. ive been using it for about 5 months with no issue.

 

if you are interested:

https://github.com/midgetspy/Sick-Beard/pull/673

http://sickbeard.com/forums/viewtopic.php?f=3&t=7183&p=35458#p35458

Be careful about auto cleaning the library. If the array goes offline for some reason and the script runs, it will wipe your library clean :-)

  • Author

yes, that's a good point. if xbmc is able to access the database but unable to access the files, it will assume the files are not there and delete them from the database.

 

however, i dont remember, do unraid plugins still run with the array stopped? if so, keeping the database and the files on the array should solve that, since the database should only be accessible if the files are.

The plugin I used does a check to see if it can access the files before it runs the clean command. 

 

Sent from my SAMSUNG-SGH-I727 using Tapatalk 4

 

 

You could also have a cronjob that dumps the mysql database every day... just in case :)

 

mysqldump -u [uSERNAME] -p[PASSWORD] [NAME OF DATABASE]  > [FOLDER ON UNRAID]/[NAME OF DATABASE].`date +"%Y-%m-%d"`.sql

 

for example it could be a cronjob that would look like this:

 

1 8 * * * mysqldump -u xbmc -pxbmc MyVideos75  > /mnt/user/Backups/Mysql/MyVideos.`date +"%Y-%m-%d"`.sql

  • 3 weeks later...

Here is my first post, so hello everyone :) I'm quite new to unRAID, but I've been playing with it for the last 2 weeks. I'm Linux-aware, so I know my way around a little bit.

 

I'm running XBMC 13 alpha 9 on my HTPC, and the versions of the databases have been incremented since Frodo 12.2... I've tried playing with the <name> tag in the advancedsettings.xml, without success.

My question here is : if I wanted to include the last alpha in the plugin, how would I go? Do I need to compile XBMC 13 from source? If so, how? Would you have an How To (not necessarily really detailed, just the main steps...). Or even better, when do you plan on updating the plugin? When v13 goes stable?

 

Thanks :)

 

Vincent

if you can get gothem working with this that would be awesome, since it is stuck on Frodo that's why all my machines haven't moved

Little problem:

XBMC requires python 2.7 while couchpotato requires python 2.6.6, because 2.7 doesn't include LIBIFF and the "manage library" part of couchpotato doesn't work without it.

XBMC doesn't work with 2.6.6... how can I install libiff with 2.7?

Here is my first post, so hello everyone :) I'm quite new to unRAID, but I've been playing with it for the last 2 weeks. I'm Linux-aware, so I know my way around a little bit.

 

I'm running XBMC 13 alpha 9 on my HTPC, and the versions of the databases have been incremented since Frodo 12.2... I've tried playing with the <name> tag in the advancedsettings.xml, without success.

My question here is : if I wanted to include the last alpha in the plugin, how would I go? Do I need to compile XBMC 13 from source? If so, how? Would you have an How To (not necessarily really detailed, just the main steps...). Or even better, when do you plan on updating the plugin? When v13 goes stable?

 

Thanks :)

 

Vincent

 

Had the same problem... wanted to run gotham monthly/nightlies, but needed a version that used the current MyVideos76/MyMusic37 database versions.

 

If bobbintb wants to do a Gotham version, he's welcome to a copy of my already compiled Gotham alpha7.  I don't use this plugin, but it's been rock solid on an ubuntu VM.  Or I can compress the install and share, if you're prepared to graft it into the plugin yourself.

 

 

Regards,

overbyrn

 

  • Author

As far as gotham goes the plugin will only use the current stable release. It is just not worth the time and effort to be constantly updating the plugin for nightlies. I don't even have much time with the stable release as it is. However, there are links in the OP on the process I used if anyone wants to do a fork.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.