Gå til hovedinnhold

XBMC library - sharing and securely saving library in a database / mysql

So first of all you should look at XBMC's official explanation as it's probably more presice than mine now:
http://wiki.xbmc.org/index.php?title=HOW-TO:Sync_multiple_libraries

I will short it down to the basics:
When you add a source in XBMC the library automatically stores itself on a local database called Sqlite on your local filesystem somewhere. Most people don't know about this and it will easily be lost when reinstalling.
To not lose your library information that has been recorded over a long time you really should use a database like MySQL to store it. More databases is probably supported and equally set up.
Library information is stuff like which episodes and movies have you seen, have you seen only half the movie etc. It also contains filepaths for each and every file. So all you need to watch your videos and listen to your music is stored here.
It will also suit for sharing the information if you have several xbmc installations (I will refer to them as clients from now on) and are switching between them.
You should add the MySql server software on a computer that's always turned on. The XBMC will not work if it can't reach the mysql db after this configuration. Probably you already have a file server that suits for this purpose as well.

Remember that the sources themselves will not be stored in mysql, I will come back to this in the end.

1. Install MySql
can be downloaded here. Make sure you set the setting that makes it reachable from outside of the server.

2. Create a user and grant full access to the two database 
For Example:
CREATE USER 'xbmc' IDENTIFIED BY 'xbmcpassword'; 
GRANT ALL ON *.* TO 'xbmc'; --do this on both databases

XBMC will create the databases it needs.

3. Create advancedsettings.xml 
containing this:

<advancedsettings>
    <videodatabase>
        <type>mysql</type>
        <host>***.***.***.***</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmcpassword</pass>
    </videodatabase> 
    <musicdatabase>
        <type>mysql</type>
        <host>***.***.***.***</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmcpassword</pass>
    </musicdatabase>
</advancedsettings>

5. Put advancedsettings.xml on the local home configuration area for xbmc
For Windows:
%APPDATA%\XBMC\userdata

For Linux:
~/.xbmc/userdata

Next time you open a XBMC client it will add all the tables and information by itself. No more configuration is needed.

6. Final point - Some concerns about the sources when using more clients
Sources concern 1:
The source paths you use must be available for any client in the same shape. Meaning you can't use a mapped network station on your windows client and then use the upnp streaming on the linux client. It just won't work because xbmc saves the full paths when a new file is discovered.
I use for example this path on all clients for the movies:
smb://SERVER/MEDIA/MOVIES
The EASY way to do this is to copy sources.xml and passwords.xml from the userdata folder referred to in 5.

Sources concern 2:
If you want all clients to be able to discover new files you MUST add the sources under Video or Music. And you must of course declare these sources the same way on all clients. For the same reasons as under sources concern 1. If you choose not to declare sources on one client, you will still be able to see all videos and music that is already added to the database. But you will then rely on another client to update the library when new files arrive.

Kommentarer

Populære innlegg fra denne bloggen

Galaxy Tab 7 GT-P1000 - install Gingerbread

1st here's a good full guide with descriptions that I've read through here . 2nd there another good guide here . Download Samsung Kies here . Download Odin 1.7 from XDA-developers  here . Download Firmware of chosen version here  (tsar3000) or here  (thegalaxytabforum). Now this is how you do it step by step: 1. Install Samsung Kies and connect your Tab If you haven't already installed Kies and tested that your tab can connect to your computer, you should do it now. This is mainly because Kies will take care of the needed drivers to connect to the computer. So go ahead and check if there's connection. 2. Put your tab into download mode Turn it off - then turn it on by holding power button and volume down button. You need this to work before you can go on. Should look like this: 3. Start Odin and connect the Galaxy Tab Just start Odin and connect the tab with USB. If it connects the ID:COM field will look something like this:  with the te...

Galaxy Tab GT-P1000 - fix partitions

This little guide is written down after I managed to screw up my partitions on my Galaxy Tab while rooting it. Luckily I still had some space that allowed me to reinstall stock firmware through Odin. I wrote a blog post on how to do this here . Then I had to get a recovery bootloader that gave me root access in recovery mode and the parted tool. So if you have a booting Android but with fucked up partitions, try this. PS! Android will probably not boot after this. So know you will have to reinstall. And if you have something on your SDcard you should back it up, you probably need to remove all partitions if you have a real screw up. You can resize if you want to get advanced though. The guide is written for windows command line . 1. You device must be booted into Android at first. Install Samsung Kies and make sure it can connect to your PC, you need the drivers that comes with it. 2. Install ADB, it comes with Android SDK . When you have ADB you should test it. First set your...