Kodi Community Forum

Full Version: Script for syncing thumbnails (and art in general), in a shared library setup ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm using a setup with 5 xbmc clients sharing the same library, but I have a really slow internet connection.
I read there was two solutions to solve my issue :

1. Using path substitution
2. Exporting the library as separate files, and then re-importing : this way, the URI for arts in the database will be files on the nas.

I'm about to use the second solution, but I was wondering if there was a more elegant way : a script that can download the art from the url of the database, and then update the url to refer local (nas) content.
I searched the forum with no luck ... If nothin exists, I'll try to write this script myself (I'm not a skilled script writer, but it does'nt sound too difficult). Maybe it could even be a plugin ?
I take it you are using a shared MySQL library ? If this is the case then yes, you need to add your sources using network paths only, not local paths.

You should be able to correct this by exporting the library as separate files on the client that can see all the art.. Then remove all the sources, answer yes when XBMC asks if you want to remove the content and then re-add the sources using the shared paths e.g. smb://server/Movies/ or NFS://server/Movies

Set the scraper to 'local information only' and then re-scrape. This should rebuild the library with the correct paths and avoid any duplicates.

If some of the artwork still doesn't show, even though it is present and correctly named, then turn off all the http options for sources in artwork downloader and then run it. It will pick up all your local art and set the correct paths in the db for it.
Thank you for your answer black_eagle.

I read this solution in other posts, but it lacks some flexibility : Adding new movies to the library requires to do all this again and again.

I guess I could try this with a special profile on one of the clients (ie a profile that scans and scap over the internet then exports to local files), but I'm really looking for something a little more automated.
Adding new content does not mean repeating this over again. You simply add the required media into the shared directory on the nas and (having set your scraper back to imdb or universal movie scraper on the source) you simply do an 'update library'. The only reason I mentioned exporting the library is because if your paths are not network paths, then a shared library WILL NOT WORK correctly.

Exporting, removing local sources (and associated entries in the library), re-adding the sources correctly and then scraping the local info is the fastest way to correct it. Otherwise it will all be re-scraped from the internet which takes longer.

Once the library is re-built, exporting is no longer necessary as long as you change the scraper for your content back to imdb, then XBMC will identify and correctly scrape any new media in the shared directory.

I've just added a new movie to mine. 15 seconds to do the update and propagate it across 5 clients. Smile
Ok I'll make some tests with this method at home Wink
Hmmm It seems that video added with nfo scrapper aren't added to the database ... weird :/

Edit : I had better luck with deleting everything and starting from scratch ... thought, even after importing from NFO, poster and fanarts are internet urls in the database ( urls are exported in nfo :/ )

Edit 2 : Well, even if sql db use Urls for poster and fan art, files from nas are loaded !
Black_eagle : to be sure, when you had new movies, you do this :
1.change scrapper from nfo to imdb
2.update library
3.export library (without overwriting to export just new movies related files)
4.change scrapper back to nfo

Is this correct ?
No. Change scraper from nfo to imdb. Do this once and then leave it alone unless you are using a third party media manager that auto-creates nfo files.
Update library.
End.

Then, the procedure would be as follows :-

1. Add media to shared directory.
2. Update library.
3. End

Repeat 1-3 as required every time you add something. No need to export anything any more unless you feel the need to rebuild your library from scratch.