Kodi Community Forum

Full Version: Advice for setting up video with multiple clients and shared storage/MySQL database.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I would really grateful for some general advice.

I have four RPi clients (all running Libreelec).

I have a headless Linux server with all my media on it (TV Shows and Films), and a MySQL database, that syncs the watched/resume status on all the Pis.

At the moment, I have just added my storage as a video source with no type.

I now want to start adding some fanart and season information, but I don't know what the best way to do that is:

1. Install a third party media scraper on the server itself, so that this information can be picked up by all of the clients.

2. Have each Pi scrape the media and add it to its own internal database.

3. Have any of the Pis scrape information to the server, so that any of the other Pis can then pick it up.

Any pointers for the best setup would be much appreciated.
Since all RPI's already are using the shared MySQL database it's a no brainer to me to setup the sources properly, with the correct media type. If you copy the sources.xml, you can use any of the RPI's to scrape the media.
That would be option 3.

You can use a third party scraper, like Ember, if you want more control but you still need only to sync that with one of the RPI's since they are all using the same database.
Perfect - thank you.

Option 3 it is.

What, exactly, should I be doing with the sources.xml?
Try to view as many movies/tv shows as possible, so the thumbnail cache is being loaded.

When those things are done, copy from the server from the userdata folder the following files to the other RPi clients:
- advancedsettings.xml, sources.xml
as well as the following folders (and their subfolders)
- Database/Textures13.db
- Thumbnails/*.* (otherwise, every Kodi client will have to download/fill the thumbnail cache on its own)

Reboot all Raspberry Pi boxes, and you should have access via the MySQL database on all boxes. Without Ember.
Also, make sure to enable "Wait for network (30 secs)" on the RPi clients when using MySQL.
Will there be a userdata folder on the server?

It runs headless and I have not installed Kodi on it.
Thank you so much for all the above.

Tried the above and it works perfectly.

I am interested in what, exactly, is going on.

I am correct in thinking that the MySQL database is simply keeping a list of every file in its database and that any Raspberry Pi that connects updates itself and then also looks to see whether anything else needs anything?

I take it that each Pi then uses this list to scrape data to each of its own internal library?
The RPI's will all get their metadata from the server, they don't need to scrape data from anywhere else. Artwork is different, the MySQL database only stores the url to the artwork, not the artwork itself. When a Kodi client loads the metainformation from the database it checks whether it already has a cached version of the artwork. If not, it downloads it from the url in the MySQL database.
If you use a third party media manager, it downloads the artwork and stores it (usually) in the same folder as the movie or tvshow. In that case the MySQL database stores the local link to the artwork instead of an internet url. The advantage is that you don't need to download it more than one time.

All Kodi clients keep the artwork in their own local cache since it is faster than downloading it everytime, even when the artwork is stored on a server in your own network.
Thank you for the really great/clear explanation - credit where due, this really is a fantastic way of doing things.

Very happy camper!