(2012-10-07, 15:17)XBL. Wrote: (2012-09-03, 14:47)vicbitter Wrote: To use with the latest code from XBMC head (ie. Frodo)
1) If you haven't built libxbmc.so
Code:
cd xbmc-frodo directory
./bootstrap
./configure --enable-shared-lib
make
copy the libxbmc.so shared library to /lib
2) Build the sample application
a) Copy the following make and sample code into the xbmc directory under the xbmc-frodo directory
i) xbmcVideoLibraryScan.cpp
ii) make_xbmcVideoLibraryScan
b) Build the application
Code:
cd xbmc-frodo directory
cd xbmc
make -f make_xbmcVideoLibraryScan all
3) To run the sample application
Code:
XBMC_BIN_HOME=/usr/local/lib/xbmc XBMC_HOME=/usr/local/share/xbmc ./xbmcVideoLibraryScan
So I've gone through this as well, but I'm stuck at the final step. I'm unsure on how to execute the xbmcVideoLibraryScan example, specifically on what to set the paths (XBMC_BIN_HOME and XBMC_HOME) to. My guess is that XBMC_BIN_HOME should point to the freshly compiled XBMC binary, but I'm unable to locate that. My other guess is that XBMC_HOME should point to the directory containing 'userdata' and such.
Seeing how they're both guesses, can somebody tell me what they really should be?
On my side, I don't have to set environment variables. I set a XBMC folder in /opt/xbmc which contains:
- all xbmc subfolders (addons, language, media, sounds, system, userdata)
- minified-xbmc binary
In /usr/lib:
- libxbmc.so
- libnfs.so.1 build from sources.
I had to add libnfs.so.1 in /usr/lib too for NFS scanning to work, because this is not a dependency strictly speaking (binary works without it) but log file was complaining about it and NFS scanning didn't work.
I launch "/opt/xbmc/minified-xbmc --nolirc -p" (-p for portable mode which keeps all settings in <xbmc_folder>/portable_data/ (launch binary once to create the folder, then set all your .xml inside: advancedsettings, guisettings, sources)
I think there is multiple server version code around (at least one which do library update and halts, and one which works as a daemon).
With daemon version, you can use Curl to request library update:
Code:
curl -i -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "1"}' http://127.0.0.1:8080/jsonrpc
Change 127.0.0.1 to xbmc server IP if you want to request it from another computer.
You can automate Video library update by setting a cron. For example, create a file "xbmc_cron" in /etc/cron.hourly to update library once per hour:
Code:
#!/bin/sh
curl -i -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "1"}' http://127.0.0.1:8080/jsonrpc
Don't forget to allow execution (chmod ug+x /etc/cron.hourly/xbmc_cron)