Forum

Full Version: [Tutorial] Shared Library / Shared Sources
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I made this on the git wiki, but maybe is handy to have it on the forum wiki as well.

http://wiki.xbian.org/index.php?title=Shared_Sources

Any questions, feel free to ask.
I miss the shared thumbnail storage Smile
Why does Xbian not use the default table names xbmc_video and xbmc_music? I followed this (http://ozymandyaz.blogspot.nl/2011/08/configure-synology-nas-as-mysql-server.html) tutorial, but somehow see that Xbian makes it's own table names.
(21st May, 2013 01:19 AM)Smiggel Wrote: [ -> ]Why does Xbian not use the default table names xbmc_video and xbmc_music? I followed this (http://ozymandyaz.blogspot.nl/2011/08/configure-synology-nas-as-mysql-server.html) tutorial, but somehow see that Xbian makes it's own table names.

"Sorry, the page you were looking for in this blog does not exist."

xbmc_video and xbmc_music is not standard. look point 5.

http://wiki.xbmc.org/index.php?title=HOW-TO:Share_libraries_using_MySQL/Advanced_notes

anytime you can override the names in advancedsettings.xml like this (xbmc will ALWAYS add version number (of the DB template, not XBMC version) as suffix):

<videodatabase>
<type>mysql</type>
<host>xbmcdb.private</host>
<port>3306</port>
<user>USERNAME</user>
<pass>PASSWORD</pass>
<name>xbmc_MyVideos</name>
</videodatabase>

<musicdatabase>
<type>mysql</type>
<host>xbmcdb.private</host>
<port>3306</port>
<user>USERNAME</user>
<pass>PASSWORD</pass>
<name>xbmc_MyMusic</name>
</musicdatabase>
Sorry for the noob question, but could you provide a step by step on how to copy over a advancedsettings to the pi. I have the rest setup as I have several different Macs using a shared resource of my synology NAS, but would like to know what is the easiest way to copy over my sources.xml and advancedsettings.xml files from one of my macs to the pi. I assume this can be done in terminal via ssh? Any help would be appreciated.
(21st May, 2013 03:59 AM)mk01 Wrote: [ -> ]
(21st May, 2013 01:19 AM)Smiggel Wrote: [ -> ]Why does Xbian not use the default table names xbmc_video and xbmc_music? I followed this (http://ozymandyaz.blogspot.nl/2011/08/configure-synology-nas-as-mysql-server.html) tutorial, but somehow see that Xbian makes it's own table names.

"Sorry, the page you were looking for in this blog does not exist."

xbmc_video and xbmc_music is not standard. look point 5.

http://wiki.xbmc.org/index.php?title=HOW-TO:Share_libraries_using_MySQL/Advanced_notes

anytime you can override the names in advancedsettings.xml like this (xbmc will ALWAYS add version number (of the DB template, not XBMC version) as suffix):

<videodatabase>
<type>mysql</type>
<host>xbmcdb.private</host>
<port>3306</port>
<user>USERNAME</user>
<pass>PASSWORD</pass>
<name>xbmc_MyVideos</name>
</videodatabase>

<musicdatabase>
<type>mysql</type>
<host>xbmcdb.private</host>
<port>3306</port>
<user>USERNAME</user>
<pass>PASSWORD</pass>
<name>xbmc_MyMusic</name>
</musicdatabase>

Ah ok. :-) Thanks.

(27th May, 2013 11:44 AM)MM3 Wrote: [ -> ]Sorry for the noob question, but could you provide a step by step on how to copy over a advancedsettings to the pi. I have the rest setup as I have several different Macs using a shared resource of my synology NAS, but would like to know what is the easiest way to copy over my sources.xml and advancedsettings.xml files from one of my macs to the pi. I assume this can be done in terminal via ssh? Any help would be appreciated.

You can use the terminal to make a new file. SSH into the PI and browse to the folder where the file is stored. Use nano advancedsettings.xml to open the file in nano and you can edit it from there.
(27th May, 2013 05:16 PM)Smiggel Wrote: [ -> ]You can use the terminal to make a new file. SSH into the PI and browse to the folder where the file is stored. Use nano advancedsettings.xml to open the file in nano and you can edit it from there.

Thanks that did the trick. Never used nano before, but it was pretty simple in the end.

edit: For others following if you enable smb add-on on the xbian pi via terminal this then allows you to use finder or pathfinder (hidden file view must be enabled) on Mac to easily browse and edit the required files, without having to use terminal...
(27th May, 2013 10:46 PM)MM3 Wrote: [ -> ]
(27th May, 2013 05:16 PM)Smiggel Wrote: [ -> ]You can use the terminal to make a new file. SSH into the PI and browse to the folder where the file is stored. Use nano advancedsettings.xml to open the file in nano and you can edit it from there.

Thanks that did the trick. Never used nano before, but it was pretty simple in the end.

special bonus:
- put mediasources.xml and sources.xml on the NAS
- edit advanced.....xml on each Mac and RPi

put
Code:
<pathsubstitution>
<substitute>
    <from>special://masterprofile/sources.xml</from>
    <to>/Network/Servers/media.private/xbmc/userdata/sources.xml</to>
</substitute>
<substitute>
    <from>special://masterprofile/mediasources.xml</from>
    <to>/Network/Servers/media.private/xbmc/userdata/mediasources.xml</to>
</substitute>
</pathsubstitution>

and you have shared sources instantly available everywhere. you can do the same with favorites.xml

the <to>...</to> can be regular folder (I have nfs mounted central xbmc setting folder on each machine), but it can be "nfs://" , "smb://" anything what xbmc understands.

mk
(2nd Jun, 2013 05:14 AM)mk01 Wrote: [ -> ][quote]

special bonus:
- put mediasources.xml and sources.xml on the NAS
- edit advanced.....xml on each Mac and RPi

put
Code:
<pathsubstitution>
<substitute>
    <from>special://masterprofile/sources.xml</from>
    <to>/Network/Servers/media.private/xbmc/userdata/sources.xml</to>
</substitute>
<substitute>
    <from>special://masterprofile/mediasources.xml</from>
    <to>/Network/Servers/media.private/xbmc/userdata/mediasources.xml</to>
</substitute>
</pathsubstitution>

and you have shared sources instantly available everywhere. you can do the same with favorites.xml

the <to>...</to> can be regular folder (I have nfs mounted central xbmc setting folder on each machine), but it can be "nfs://" , "smb://" anything what xbmc understands.

mk

What are the advantages of doing this way? Is there any code that goes within mediasources.xml file?
(2nd Jun, 2013 04:28 PM)MM3 Wrote: [ -> ]What are the advantages of doing this way? Is there any code that goes within mediasources.xml file?

you media sources (and changes in scrappers settings defined on those sources) always read from the central location, updated as well only there.

it's like the shared db, you can add a source / favorite on any xbmc and you will see it on all other installations of xbmc and vice versa.

the path substitution means the files are not going to be copied to local machine. they are shared from the one location.

it's also possible to share add-ons settings this way. as soon as you install new add-on which already you have configured on other pc / atv / rpi, the add-on will work with the global shared setting. with more xbmc installations you don't have to walk always around the house to update & configure each installation.

(and in case of crash/reinstall you just install clean xbmc, the same set of modules and all other is taken from central location, so in few seconds you have the same media as before)

mk
I still have to lookup, how i can share addons arcoss xbmc's
(2nd Jun, 2013 09:26 PM)brantje Wrote: [ -> ]I still have to lookup, how i can share addons arcoss xbmc's

this is bit tricky. method how to achieve is the same - path substitution - or mount to xbmcs addon directory.

normally, Thumbnails, add-on_data, mediasources and sources works with no issues. With addon scripts you can run into troubles from two reasons:

1) different versions and dependencies according to installed xbmc
2) the fact, that xbmc keeps addons physically in add ons folder, but informations about them in Databases/Addons.db. This db can't be moved to shared SQL and sqlite provides no locking/sharing mechanism.

so by substituting addon path (or centrally mounting it) you will not make your xbmc installation be aware of the addons. there needs to be related record in Databases/Addons.db sqlite db. and to this, you are not able to provide shared access (if you start more than xbmc at a time).

so once again, music and video library can be central "shared", thumbnails folder, addon_data, sources.xml, mediasources.xml, favorites.
(2nd Jun, 2013 05:08 PM)mk01 Wrote: [ -> ]
(2nd Jun, 2013 04:28 PM)MM3 Wrote: [ -> ]What are the advantages of doing this way? Is there any code that goes within mediasources.xml file?

you media sources (and changes in scrappers settings defined on those sources) always read from the central location, updated as well only there.

it's like the shared db, you can add a source / favorite on any xbmc and you will see it on all other installations of xbmc and vice versa.

the path substitution means the files are not going to be copied to local machine. they are shared from the one location.

it's also possible to share add-ons settings this way. as soon as you install new add-on which already you have configured on other pc / atv / rpi, the add-on will work with the global shared setting. with more xbmc installations you don't have to walk always around the house to update & configure each installation.

(and in case of crash/reinstall you just install clean xbmc, the same set of modules and all other is taken from central location, so in few seconds you have the same media as before)

mk

Ok, I am convinced. So can you described the steps for not so literate? Is it something like this:

1. Create mediasources.xml file. I'm not sure of its contents? Or is it a blank file that xbmc will write to? Place that file on my NAS, say in my media share/directory in a directory I created called 'xbmcdata'.
2. Do the same for the sources.xml - again is this file blank and will be written to when set up on one of the xbmc's? Or is the contents of the sources folder the same as it is now - pointing to the correct share/directories?
3. Edit the advancedsettings.xml file on each machine by adding the above code, eg, (from my Pi):

Code:
<advancedsettings>
<videodatabase>
        <type>mysql</type>
        <host>10.0.0.5</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </videodatabase>

<musicdatabase>
        <type>mysql</type>
        <host>10.0.0.5</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </musicdatabase>

     <videolibrary>
          <importwatchedstate>true</importwatchedstate>
     </videolibrary>

<pathsubstitution>
<substitute>
    <from>special://masterprofile/sources.xml</from>
    <to>smb://10.0.0.5/Media/xbmcdata/sources.xml</to>
</substitute>
<substitute>
    <from>special://masterprofile/mediasources.xml</from>
    <to>smb://10.0.0.5/Media/xbmcdata/mediasources.xml</to>
</substitute>
</pathsubstitution>

<network>
        <cachemembuffersize>20971520</cachemembuffersize>
   </network>
   <fanartres>540</fanartres>
   <imageres>256</imageres>
   <gputempcommand>echo "$(/opt/vc/bin/vcgencmd measure_temp | grep -o "[0-9]\{2\}") C"</gputempcommand>
   <cputempcommand>echo "$(/opt/vc/bin/vcgencmd measure_temp | grep -o "[0-9]\{2\}") C"</cputempcommand>
   <lookandfeel>
        <webserver>true</webserver>
        <guires>720</guires>
   </lookandfeel>
   <bginfoloadermaxthreads>2</bginfoloadermaxthreads>
   <video>
     <adjustrefreshrate>  
       <override>
         <fps>23.976</fps>
         <refresh>24.0</refresh>
       </override>
     </adjustrefreshrate>
   </video>
</advancedsettings>

4. Do the same for each machine - Mac, RPi, Apple TV, omitting the RPi specific stuff in the advancesettings.xml file.

Is that about right?

Thanks in advance.
yes !

Wink

only that from the file you posted is 1/2 RPi relevant Wink
Thanks. Got something right for a change Cool

Which bit is not Pi relevant? The files on my other machines don't have the network, video, gpu, cpu, refreshrate, fanart or imageres code. I though those portions came from the standard xbian instal of this file?

Edit: are the sources and mediasources files I place on the NAS blank until they are populated by xbmc?

cheers
Pages: 1 2
Reference URL's