Kodi Community Forum

Full Version: Single MySQL, Multiple Profiles
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I currently run XBMC on multiple front ends, linked to a single MySQL installation and it works great.

I wanted to create a profile for my kids to separate their stuff from the the films they shouldn't see - my 4 year old loaded The Dark Knight Rises the other day ... not exactly appropriate!

I ideally wanted 3 profiles sharing a single Library (MySQL database) maintaining the same watched flags etc.
  • Master User (All Sources)
  • Grown Ups (Adult Sources - No Peppa Pig thank you!)
  • Kids (Kids Sources - No Grown Up Stuff)
With the Master User running all the updates etc, and the other two accounts being read only.

Is this possible or does each profile have to have separate libraries (mysql dbs in this case) and it's own sources?
On MySQL each profile would need a separate library DB.
That's what I thought, bummer Sad I had hoped that I could have the two client profiles as read only profiles and use only the master profile to add / edit / update media in the library.

Thanks for your reply.
I use one MySQL database for multiple devices, and simply removed the offending 'sources' from the sources.xml file on my young daughters device. The Library effectively hides the entries that are unreachable from her device. I'd expect you'd get the same behaviour with different profiles on a single device - worth experimenting with it!
Now that sounds like what I want to achieve, that gives me hope.

The problem I have is that even though I setup a new profile with a different source and different library and tell it to start fresh rather than copy from the default, I still end up seeing everything the master user sees.
@gushy Did you experiment with locking the sources on your kids' profile?

http://wiki.xbmc.org/index.php?title=Med...es#Locking
profiles.xml on adult machine looks like;

<profiles>
<lastloaded>0</lastloaded>
<useloginscreen>false</useloginscreen>
<nextIdProfile>1</nextIdProfile>
<profile>
<id>0</id>
<name>Master user</name>
<directory pathversion="1">special://masterprofile/</directory>
<thumbnail pathversion="1"></thumbnail>
<hasdatabases>true</hasdatabases>
<canwritedatabases>true</canwritedatabases>
<hassources>true</hassources>
<canwritesources>true</canwritesources>
<lockaddonmanager>false</lockaddonmanager>
<locksettings>false</locksettings>
<lockfiles>false</lockfiles>
<lockmusic>false</lockmusic>
<lockvideo>false</lockvideo>
<lockpictures>false</lockpictures>
<lockprograms>false</lockprograms>
<lockmode>0</lockmode>
<lockcode></lockcode>
<lastdate></lastdate>
</profile>
</profiles>

profiles.xml on kids machine looks like;


<profiles>
<lastloaded>0</lastloaded>
<useloginscreen>false</useloginscreen>
<nextIdProfile>1</nextIdProfile>
<profile>
<id>0</id>
<name>Master user</name>
<directory pathversion="1">special://masterprofile/</directory>
<thumbnail pathversion="1"></thumbnail>
<hasdatabases>true</hasdatabases>
<canwritedatabases>true</canwritedatabases>
<hassources>true</hassources>
<canwritesources>true</canwritesources>
<lockaddonmanager>false</lockaddonmanager>
<locksettings>false</locksettings>
<lockfiles>false</lockfiles>
<lockmusic>false</lockmusic>
<lockvideo>false</lockvideo>
<lockpictures>false</lockpictures>
<lockprograms>false</lockprograms>
<lockmode>1</lockmode>
<lockcode>********************************</lockcode>
<lastdate></lastdate>
</profile>
</profiles>

Presumably you could set up the individual <profile> sections under a single <profiles> section within the one machine?

NB. The lockcode in my example is 16 HEX pairs (32 characters), not asterisk characters!

sources.xml on adult machine looks like;

<sources>
<programs>
<default pathversion="1"></default>
</programs>
<video>
<default pathversion="1">Networked Videos</default>
<source>
<name>Networked Videos</name>
<path pathversion="1">smb://BLACKTOWER/Videos/</path>
</source>
</video>
<music>
<default pathversion="1">Networked Music</default>
<source>
<name>Networked Music</name>
<path pathversion="1">smb://BLACKTOWER/xbmc/</path>
</source>
</music>
<pictures>
<default pathversion="1">Networked Pictures</default>
<source>
<name>Networked Pictures</name>
<path pathversion="1">smb://BLACKTOWER/Pictures/</path>
</source>
</pictures>
<files>
<default pathversion="1"></default>
</files>
</sources>

sources.xml on kids machine looks like;

<sources>
<programs>
<default pathversion="1"></default>
</programs>
<video>
<default pathversion="1"></default>
<source>
<name>Kids TV</name>
<path pathversion="1">smb://BLACKTOWER/Videos/Kids TV/</path>
</source>
<source>
<name>Kids Movies</name>
<path pathversion="1">smb://BLACKTOWER/Videos/Kids Movies/</path>
</source>
<source>
<name>Home Movies</name>
<path pathversion="1">smb://BLACKTOWER/Videos/Home Movies/</path>
</source>
</video>
<music>
<default pathversion="1">Music</default>
<source>
<name>Music</name>
<path pathversion="1">smb://BLACKTOWER/xbmc/</path>
</source>
</music>
<pictures>
<default pathversion="1">Pictures</default>
<source>
<name>Pictures</name>
<path pathversion="1">smb://BLACKTOWER/Pictures/</path>
</source>
</pictures>
<files>
<default pathversion="1"></default>
</files>
</sources>

Thanks for the extra info Fergus.

I tried with separate sources via the gui but I don't think that's writing the same xml, so I'm going to give it a go by hand next week and see if that make a difference.






Just to add to this, while I'm comfortable writing the XML files - this will possibly solve my issues - I really could do with getting to this solution via the GUI as I have some non-technical friends who I have recommended XBMC to and I really don't want to be providing configuration support if I can help it!
When I look at your kids profile.xml it shows that the last logged in user is 'Master user'. This makes me wonder whether or not you were really logged in using your kids profile.
Please be aware that xbmc on startup always logs in with the last used profile unless you use my service add-on to always load a configured default profile.
You may also want to check out the library nodes feature that is new in xbmc (I have not played with that myself yet, but it sounds like a promising feaure).
(2012-12-11, 02:55)gushy Wrote: [ -> ]I currently run XBMC on multiple front ends, linked to a single MySQL installation and it works great.

I wanted to create a profile for my kids to separate their stuff from the the films they shouldn't see - my 4 year old loaded The Dark Knight Rises the other day ... not exactly appropriate!

I ideally wanted 3 profiles sharing a single Library (MySQL database) maintaining the same watched flags etc.
  • Master User (All Sources)
  • Grown Ups (Adult Sources - No Peppa Pig thank you!)
  • Kids (Kids Sources - No Grown Up Stuff)
With the Master User running all the updates etc, and the other two accounts being read only.

Is this possible or does each profile have to have separate libraries (mysql dbs in this case) and it's own sources?

I have something similar to this.
Master User (this has no sources and I never use it)
Adults(with exclusive adult sources and shared content)
Kids(with exclusive kid content and shared content)
All under the same MySQL DB

The accounts aren't read only and to add content you need to scan on both accounts. The shared content typically requires to be scrapped in on one account and then rescanned on the other in order to show all the proper thumbnails. That said I have two accounts that I can access from all of my machines that have completely separate content.