Win 2 instances of XBMC connected to a NAS - Setup?
#1
Hey together,

now that I have finally set up my whole home cinema and datacenter, I started using 2 instances of XBMC each on one single media pc attached to a tv and connected to one NAS. The NAS is prepared and both media pcs with XBMC also work very well. I scrape my media with Ember and completely deactivated XBMC's own scraping service on startup. Everything's working perfect so far with a little issue that I dont seem to be able to fix: The "watched" state.

What's the problem?
The watched state seems to work on one XBMC for its own and the other one for its own, but they don't recognize the other XBMC's states properly. E.g. when I watch a movie on XBMC 1 it appears as watched but when I look it up on the XBMC 2 it is marked as non-watched.

This is what my advancedsettings.xml looks like:
Code:
<advancedsettings>
    <videolibrary>
        <importwatchedstate>true</importwatchedstate>
    </videolibrary>
    
    <video>
        <playcountminimumpercent>80</playcountminimumpercent>
    </video>
    
    <videoscanner>
        <ignoreerrors>true</ignoreerrors> <!-- Set to true to silently ignore errors while scanning videos. This prevents the error dialogue box, so you don't have to keep hitting "yes" to keep scanning.-->
    </videoscanner>
    <loglevel>2</loglevel>
</advancedsettings>

So, do other people use this setup and what's actually the best way to configure each XBMC when scraping with Ember and having both systems use the same data from a NAS?

Thanks alot,
best regards,
Dan
Reply
#2
Do some reading on MySQL

Quote:Introduction
If you have more than one XBMC device on your local network then you might want to synchronize them using a MySQL library. Using a MySQL library allows you to store information about your whole video library in a central database, so that multiple XBMC devices can access the same information at the same time.

This gives you the ability to do things like:

Share watched and unwatched status for your media on all devices
Stop watching a movie or TV show in one room then finish watching it in another room automatically
Only one library to maintain for all devices
Reply
#3
Unless you use a centralised database, you won't be able to synchronise the watched status, whilst also keeping them both able to operate independently (or at the same time)

This is where setting up a MySQL server will benefit you - you have a centralised library (meaning only 1 database to keep updated), watched flags will appear on both, as well as being able to stop a video on one, and pick it up in exactly the same place on the other.

Most NAS boxes can run MySQL - it's a relatively simple setup, and you'll gain a load of usability.
Reply
#4
Thanks for the information to both of you, this already clears up things a bit.

So if I understood it correctly, there is no way 'round a MySQL server on my NAS if I want to share watched/position states, right?

I thought that with the advancedsettings.xml I can make sure that the information gets saved in the .nfo and therefore is also available on other devices. What about the trakt.tv plugin btw? Isn't it capable of "tracking that" as well?

How can I set up a MySQL connection so the information is shared on my NAS as well? I have no idea how to do this. Is there a tutorial or even a different method of sharing the "watched state"?
Reply
#5
Think of it this way:

Right now you have 2 seperate libraries which work independently of each other. These libraries cannot talk to each other in any way.

With a MySQL setup:

You have 1 library, and each computer with XBMC gets its information from that library.

Your first step should be, determine what NAS you have and see if supports a native MySQL installation. If it does, proceed to your NAS vendors website and read up on how to install/configure it. If it doesn't, you can install MySQL on a regular computer as well, mind you, it would have to be on 24/7 if you wanted any of your other XBMC installs to access the library at any time.
Reply
#6
Your advancedsettings only deals with what happens upon initial import of the item into the library.

Yes, for synchronised watch status, you will require MySQL. Even the latest alpha Gotham releases only synchronise watch status without MySQL by having at least one of the computers on all the time, and acting as a "server" by sharing it's library - not great if you only ever want to actually use one machine at a time, but ensure that they are synchronised.


So - what make/model is your NAS? If you can't find details on how to configure MySQL, then someone here will be able to help you.
Reply
#7
I use Nightly builds (wiki) and UPnP (wiki).

NFO files are only used once, when the media is scanned in for the first time. You can refresh that data manually and individually, but it's not a practical way to share information. NFO files are meant to be more of a backup. NFO files are also only written to when you export the library.
Reply
#8
(2014-01-21, 11:47)Ned Scott Wrote: I use Nightly builds (wiki) and UPnP (wiki).
I have also installed a Gotham monthly build, but how does the UPnP work actually? Do both instances have to be on and running? An explanation would be helpful as well Smile
Reply
#9
(2014-01-21, 12:26)Tormentor667 Wrote:
(2014-01-21, 11:47)Ned Scott Wrote: I use Nightly builds (wiki) and UPnP (wiki).
I have also installed a Gotham monthly build, but how does the UPnP work actually? Do both instances have to be on and running? An explanation would be helpful as well Smile

One XBMC instance becomes a UPnP host, and the other XBMC instances access it as a file source. Using skins that support custom home items you can easily access specific parts of the UPnP host. In the future it will be possible to actually merge/mesh UPnP sources with the local library, but even without that feature, custom home buttons work out pretty good. Or even just accessing it via the normal Files node. Even though it's accessed as a file source, full summaries and artwork are available. (it seems only posters get shared if you use both posters and banners, however).

Since one XBMC instance is the host, that one would need to stay on to be accessed. Everything that XBMC instance has, both in just plain Files and in the Library, are accessible to other XBMC instances. Since everything from the "host" is shared, this also means you can share playlists and smart playlists, the tags nod, the sets node, etc. When you watch something on the other XBMC instance, it is marked as watched on the host instance, and will show up as watched on other instances. Same with stopping part way in a video and resuming on another device or on the "host". However, right now watched/resume marks doesn't seem to appear in the GUI right away when you are on a "client" instance. Hopefully that will be worked out in the near future.

UPnP also allows you to easily jump into a library while keeping the internal one separate, which is nice on a portable device that might not always be able to access a local NAS.
Reply
#10
@ned Scott - Thanks a lot for that explanation, I understood that Smile Unfortunately I don't want to have one XBMC instance permanently online, simply to save power and costs. Do you know (or is there a tutorial) where it is explained how a MySQL DB can be used to synchronize two XBMC instances? I have a QNAP TS-419 II P and it is capable of running a MySQL Server, but I have no idea how to set this up for XBMC...
Reply
#11
The basics are explained in the Wiki article HOW-TO: Share libraries using MySQL (wiki)

Configuring XBMC on your QNAP NAS is outlined in an article I've found here (I don't own a QNAP box myself, so I can't guarantee how correct this is)


The process itself is rather simple, and then you get a centralised library with watched state and resume state (amongst other things) all nicely centralised. You can configure both of your boxes to "update" the library if needed, so that no matter which box you turn on, any new items will be picked up and added.
Reply
#12
Thanks for the info. Out of curiosity, if you only want to share the watched-status, is there a way to connect both instances without using MySQL? The watchedstate is stored in the .nfo, is it pssobiel to make XBMC parse every nfo at startup?
Reply
#13
You could use the trakt addon.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#14
Hi, do you have the two instances of xmbc on the same pc, or one each?
Reply

Logout Mark Read Team Forum Stats Members Help
2 instances of XBMC connected to a NAS - Setup?0