Kodi Community Forum

Full Version: Shared XBMC, server and client, path formatting?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am currently running XBMC on my main HTPC, All my files are also there, and now I have bought an Raspberry for the sleeping room, which I want to use as I client.
I also read about putting the XBMC data in MySQL.
But I also read about path formatting and updating issues.
What is the proper way to accomplish a server-client support, how do I define the paths on both devices so I won't get duplicated, and a nice sync?[/quote]
You can use MySQL to have a synchronised library between the multiple devices.

You also need to ensure that both are using the same sources - so on both, you need to reference the source via it's network address, for example:

smb://NAS/Media or nfs://NAS/Media
That's where the problem is.
The media is located directly on the bigger htpc.
I read about making symlinks, but can I do that over the network?
Let's say, my media is on the server:

/storage/movies

Can I make a symlink on the client as:

/storage/movies ==> whateverprotocol://ip-of-server/storage/movies

Is that an option?
Then that path which is already configured like that, should work for both.
It's just a theory, I don't know how to realize this.
UPnP (wiki) sharing?
With upnp sharing you don't have the watched status right? (And start where you stopped the movie downstairs)
You'll need to share the media on the PC where it's located, then point BOTH devices at the network share.
Even when the shares are located on the main XBMC device? (Locate them to its own IP and the client to the same ip)
(2014-08-05, 16:20)subcityzero Wrote: [ -> ]With upnp sharing you don't have the watched status right? (And start where you stopped the movie downstairs)

You have watched status and resume marks, but it's a little buggy on the client side (it doesn't always display the updated status, but it will record the correct status back to the server).
(2014-08-05, 16:47)subcityzero Wrote: [ -> ]Even when the shares are located on the main XBMC device? (Locate them to its own IP and the client to the same ip)

Yes. All devices need to access the files by the same path - and the only path common to them all is the network share path.
(2014-08-05, 17:05)ConfusedTA Wrote: [ -> ]
(2014-08-05, 16:47)subcityzero Wrote: [ -> ]Even when the shares are located on the main XBMC device? (Locate them to its own IP and the client to the same ip)

Yes. All devices need to access the files by the same path - and the only path common to them all is the network share path.

Thank you.
So if for example my htpc is on ip 192.168.1.12 both devices including the 'localhost' htpc gets paths with 192.168.1.12 as the host.

Whats the best protocol for sharing the mounts? Nfs? Smb?
NFS is a "lighter" protocol, so as you've got something low powered like a Raspberry Pi, if you think you may be watching large (20GB+) films on it, then this might be better.

But, really, either will do, and it's down to personal preference. I am fully Windows based at home, so I use SMB.


Concentrate on getting 1 machine set up first (leave the Pi out of it for now), then it is as simple as copying the "advancedsettings.xml" file (and the "sources.xml" file, if you want both machines to be able to update the library) to the other computers.


So - on your existing XBMC box...

Essentially, follow this guide...


Export your library to single files - this will create an XML file for each video file, in the same directory where your videos sit.

Share your media.

Install MySQL, following the instructions on how to set up a user.

Create an advancedsettings.xml file, specifying the MySQL details (host, username, password etc), and be sure to set the "import watched status" part.

Remove any existing "sources.xml" and "passwords.xml" file from your XBMC directory (where you placed the "advancedsettings.xml" file)

Run XBMC, and you'll find you have an EMPTY DATABASE. Do not panic, this is desired at this stage!

Set up your source, but rather than selecting the local directory, ensure you choose your desired network sharing type first (NFS or SMB).

Once you do this, and add this source to the library, it will browse through all your files, and add them to the database, including your watched status (remember, when we exported the library as single files earlier, we saved this information)


Now - your first PC should be done!


Copy the advancedsettings.xml (and, if needed, sources.xml) file to the right place on the Pi, and start XBMC - you should immediately be able to access your library - WITHOUT doing anything else!

It's really not too difficult, the guide I linked right near the top of this post does outline every step in detail, be sure to read it through completely before starting do to anything!
Thank you very much!
Really helpful. Found a few guides quite similar, I will follow yours. I am already quite familiar with XBMC but not the shared library part.

So I think it will work out just fine. Should also be quite easy since I have everything running Linux.
Make sure you get your permissions right for the exported directories if you're using NFS Wink
Hello,

Here I am again.
I though it would be fair to share my result; it works perfectly.

The sources.xml now contains only smb://<serverip>/<sharename> and these are indexed with 'Local data only' to make it a bit quicker to index.
After this is done for all libraries, copying the sources.xml and advancedsettings.xml (part which contains mysql connection info) and restarting the PI, and it works flawlessly.

Later I will find out how nfs shares work, for now, SMB does the job,

Thank you very much, works perfect.