How-to share a central Thumbnails directory between multiple XBMC boxes
#1
Lifehacker already taught us how to use a central MySQL database to share the XBMC library between multiple XBMC boxes. However, the library doesn't include the fanart and covers (they're stored in userdata\Thumbnails). I've read about several ways to synchronize or share the thumbnails by using third-party syncing software to sync multiple Thumbnail folders, or creating symbolic links in the OS to link your Thumbnails folder to another folder, or even just using third-party scrapers to save all metadata in your media folders so that your other boxes can scrape over the local network rather than off the internet.
Since MySQL puts your library in one location, I wanted my thumbnails to also exist in only one location (and I didn't want to use symbolic links). After some searching, I found you can change the path of the Thumbnails folder if you're using the post-Dharma nightlies. This is how I set up a central Thumbnails folder to go with my central library DB:

Prerequisites:
Update all XBMC to a post-Dharma nightly
Follow the steps to setup and use a central MySQL-based library

Procedure:
  1. Created a Thumbnails folder called XBMCThumbnails in the same location as my media
  2. Shared the XBMCThumbnails folder (it's on a Windows box, so I used normal Samba-based sharing)
  3. Pointed the local XBMC setup to use the new Thumbnail folder by adding the following code to advancedsettings.xml
    Code:
    <pathsubstitution>
        <substitute>
            <from>special://masterprofile/Thumbnails</from>
            <to>\\[ServerName]\XBMCThumbnails</to>
        </substitute>
    </pathsubstitution>
  4. Updated my library
  5. Set my other XBMC boxes to point to the new Thumbnails folder using the following code:
    On Windows boxes:
    Code:
    <pathsubstitution>
        <substitute>
            <from>special://masterprofile/Thumbnails</from>
            <to>\\[ServerName]\XBMCThumbnails</to>
        </substitute>
    </pathsubstitution>
    On my ATV2:
    Code:
    <pathsubstitution>
        <substitute>
            <from>special://masterprofile/Thumbnails</from>
            <to>smb://[ServerName]/XBMCThumbnails</to>
        </substitute>
    </pathsubstitution>

So far it's working great. Note that performance will vary by machine capabilities (my ATV2 takes about 1-2 seconds to populate thumbnails while the other boxes are almost instant).

Hope this helps anyone else.
Reply
#2
Just to note. I believe path substitution for thumbnails only works on post-dharma builds.

On my Dharma boxes, I followed what this user did, utilizing dropbox:

http://forum.xbmc.org/showpost.php?p=834...tcount=211
Reply
#3
gabbott Wrote:Just to note. I believe path substitution for thumbnails only works on post-dharma builds.

On my Dharma boxes, I followed what this user did, utilizing dropbox:

http://forum.xbmc.org/showpost.php?p=834...tcount=211

Yep. I noted that in my post, but I'll make it clearer. Thanks.
Reply
#4
I have designed a simple script that runs on the server I have where the mysql database is. It grabs new thumbs and transfers them to the server and then downloads to each machine. I can also set to copy playlists, rss feeds, media sources and mirror my image directory that I store backdrops and screensaver images.

The system works perfectly and everything has a local cache that is updated every 5 minutes.

I have found some issues with the latest builds though that affect the database and remote apps which keep causing disconnects and am waiting for this to be fixed.

I will post my script if there is interest. Simple batch script that should run on any windows system and should be easy enough to cmodify. Not tested to an ATV yet though.
Reply
#5
phsyraxion Wrote:I have designed a simple script that runs on the server I have where the mysql database is. It grabs new thumbs and transfers them to the server and then downloads to each machine. I can also set to copy playlists, rss feeds, media sources and mirror my image directory that I store backdrops and screensaver images.

The reason I didn't go with any syncing method is I didn't see a need to store the Thumbnails in more than one place. If the library's in one place (MySQL) then I thought the Thumbnails should only be in one place too. Also, I never have to worry about whether everything has finished syncing already or worry about which XBMC machine I'm making changes on. I can perform library updates on my ATV2, my laptop, or my media server and they all populate the changes live because they're reading from the same folder.
I don't need to sync my media sources as all my media sources are always scanned into the central library. Pretty sure you could do path substitution with feeds, playlists, and other images, too.
Reply
#6
Great guide. I got it working on Linux where I've used a mount but can't get it to work under OSX Lion?

Code:
23:48:11 T:2895815360  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <videodatabase>
                                                <type>mysql</type>
                                                <host>192.168.1.100</host>
                                                <port>3306</port>
                                                <user>xbmc</user>
                                                <pass>xbmc</pass>
                                                <name>xbmc_video</name>
                                              </videodatabase>
                                              <musicdatabase>
                                                <type>mysql</type>
                                                <host>192.168.1.100</host>
                                                <port>3306</port>
                                                <user>xbmc</user>
                                                <pass>xbmc</pass>
                                                <name>xbmc_music</name>
                                              </musicdatabase>
                                              <pathsubstitution>
                                                <substitute>
                                                  <from>special://masterprofile/Thumbnails</from>
                                                  <to>smb://media:media@MediaServer/XBMCThumbnails</to>
                                                </substitute>
                                              </pathsubstitution>
                                            </advancedsettings>
23:48:11 T:2895815360   DEBUG: Configuring path substitutions
23:48:11 T:2895815360   DEBUG:   Registering substition pair:
23:48:11 T:2895815360   DEBUG:     From: [/Users/nogi/Library/Application Support/XBMC/userdata/Thumbnails]
23:48:11 T:2895815360   DEBUG:     To:   [smb://media:media@MediaServer/XBMCThumbnails]
23:48:11 T:2895815360 WARNING: VIDEO database configuration is experimental.
23:48:11 T:2895815360  NOTICE: Getting hardware information now...
23:48:11 T:2895815360    INFO: Using digital output
23:48:11 T:2895815360    INFO: AC3 pass through is enabled
23:48:11 T:2895815360    INFO: DTS pass through is enabled
23:48:11 T:2895815360    INFO: AAC pass through is disabled
23:48:11 T:2895815360    INFO: MP1 pass through is disabled
23:48:11 T:2895815360    INFO: MP2 pass through is disabled
23:48:11 T:2895815360    INFO: MP3 pass through is disabled
23:48:11 T:2895815360  NOTICE: Checking resolution 11
23:48:11 T:2895815360  NOTICE: Default DVD Player: dvdplayer
23:48:11 T:2895815360  NOTICE: Default Video Player: dvdplayer
23:48:11 T:2895815360  NOTICE: Default Audio Player: paplayer
23:48:11 T:2895815360  NOTICE: Loading media sources from special://masterprofile/sources.xml
23:48:11 T:2895815360    INFO: creating subdirectories
23:48:11 T:2895815360    INFO: userdata folder: special://masterprofile/
23:48:11 T:2895815360    INFO: recording folder:
23:48:11 T:2895815360    INFO: screenshots folder:
23:48:11 T:2895815360    INFO: thumbnails folder: special://masterprofile/Thumbnails

When I load it up, it still shows the local thumbnails.
Reply
#7
That's strange. I don't have a Mac, but I assume it uses the same smb:// code as ATV2 and Linux. The only difference I see is that I'm using open shares (no username or password). Maybe passworded shares don't work in path substitution. I guess you could test it by making the share open to everyone and removing the username and password from the code.
Reply
#8
Actually, was user error. Works fine (I think so far) with username/pass. I replicated between 2 NAS's and the replication was broken for xbmc data.
Reply
#9
Glad you got it working. Now that my library and thumbnails are centralized, I'm tempted to try to centralize my addons and my skin configuration, but that might be taking things a bit too far.
Reply

Logout Mark Read Team Forum Stats Members Help
How-to share a central Thumbnails directory between multiple XBMC boxes0