Kodi Community Forum

Full Version: XBMC and MySQL shared libary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here is the situation. I have serperated my movies by ratings (PG,PG-13,R) in order to control what my children have access to by group (my younger children, PG - Teenagers,PG-13&PG - Me and my Wife, all of them). I have XBMC 12.3 setup on a RasberryPI and 2 computers with a shared library. I was using an old xbox with XBMC4XBOX with my younger children but some of the more recent movies will play sound but no picture so I figure it is time to retire the old thing and it never could share the library anyway. Now I have bought a Android box and have been looking into putting the RasberryPI in the kids room but I don't want to have a separate library for them, another for my teenagers, and a third for me. then I would have to update three systems anytime I add another file.
So poking around in my MySQL database I found the view 'movieview' which selects the movie list for XBMC to display. The thing I can't find is where XBMC calls on this. if I can find the spot I could add another view of a different name and for each system use the appropriate view and still have a shared library.

movieview currently
select `movie`.`idMovie` AS `idMovie`,`movie`.`idFile` AS `idFile`,`movie`.`c00` AS `c00`,`movie`.`c01` AS `c01`,`movie`.`c02` AS `c02`,`movie`.`c03` AS `c03`,`movie`.`c04` AS `c04`,`movie`.`c05` AS `c05`,`movie`.`c06` AS `c06`,`movie`.`c07` AS `c07`,`movie`.`c08` AS `c08`,`movie`.`c09` AS `c09`,`movie`.`c10` AS `c10`,`movie`.`c11` AS `c11`,`movie`.`c12` AS `c12`,`movie`.`c13` AS `c13`,`movie`.`c14` AS `c14`,`movie`.`c15` AS `c15`,`movie`.`c16` AS `c16`,`movie`.`c17` AS `c17`,`movie`.`c18` AS `c18`,`movie`.`c19` AS `c19`,`movie`.`c20` AS `c20`,`movie`.`c21` AS `c21`,`movie`.`c22` AS `c22`,`movie`.`c23` AS `c23`,`movie`.`idSet` AS `idSet`,`sets`.`strSet` AS `strSet`,`files`.`strFilename` AS `strFileName`,`path`.`strPath` AS `strPath`,`files`.`playCount` AS `playCount`,`files`.`lastPlayed` AS `lastPlayed`,`files`.`dateAdded` AS `dateAdded`,`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` from ((((`movie` left join `sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `files` on((`files`.`idFile` = `movie`.`idFile`))) join `path` on((`path`.`idPath` = `files`.`idPath`))) left join `bookmark` on(((`bookmark`.`idFile` = `movie`.`idFile`) and (`bookmark`.`type` = 1))))

I could change it to this
select `movie`.`idMovie` AS `idMovie`,`movie`.`idFile` AS `idFile`,`movie`.`c00` AS `c00`,`movie`.`c01` AS `c01`,`movie`.`c02` AS `c02`,`movie`.`c03` AS `c03`,`movie`.`c04` AS `c04`,`movie`.`c05` AS `c05`,`movie`.`c06` AS `c06`,`movie`.`c07` AS `c07`,`movie`.`c08` AS `c08`,`movie`.`c09` AS `c09`,`movie`.`c10` AS `c10`,`movie`.`c11` AS `c11`,`movie`.`c12` AS `c12`,`movie`.`c13` AS `c13`,`movie`.`c14` AS `c14`,`movie`.`c15` AS `c15`,`movie`.`c16` AS `c16`,`movie`.`c17` AS `c17`,`movie`.`c18` AS `c18`,`movie`.`c19` AS `c19`,`movie`.`c20` AS `c20`,`movie`.`c21` AS `c21`,`movie`.`c22` AS `c22`,`movie`.`c23` AS `c23`,`movie`.`idSet` AS `idSet`,`sets`.`strSet` AS `strSet`,`files`.`strFilename` AS `strFileName`,`path`.`strPath` AS `strPath`,`files`.`playCount` AS `playCount`,`files`.`lastPlayed` AS `lastPlayed`,`files`.`dateAdded` AS `dateAdded`,`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` from ((((`movie` left join `sets` on((`sets`.`idSet` = `movie`.`idSet`))) join `files` on((`files`.`idFile` = `movie`.`idFile`))) join `path` on((`path`.`idPath` = `files`.`idPath`))) left join `bookmark` on(((`bookmark`.`idFile` = `movie`.`idFile`) and (`bookmark`.`type` = 1)))) where strPath like 'smb://MEDIA/Movies/Movies/PG/%'

by adding
where strPath like 'smb://MEDIA/Movies/Movies/PG/%'

to the end it only selects my PG folder and it's subfolders so if my kids start watching a movie in the living room or my room with the full library then can go to their room and resume the same movie. And I only have to update one system. Any help would be greatly appreciated.
Why not use a Smart Playlist (wiki) on the three systems and a modified skin that shows that playlist instead of the default view of everything ?
I tried that also. Problem was if I exit out to the home screen then click on videos I could see the entire library. With kids sometimes even the display art for a movie can be inappropriate not to mention the titles. Add to that the titles that sound innocent but aren't.
Have you tried the Confluence Customizable Mod skin.
Can show what you want in the menu and has kiosk mode aswell.
Works on the pi fine.
I'm sure, as mentioned above, using this skin with a playlist would get the result your looking for.
http://forum.xbmc.org/showthread.php?tid=160184
Use source locking: http://wiki.xbmc.org/index.php?title=Med...es#Locking

A locked source won't even show artwork in the library until it is unlocked, if I recall correctly.
Just installed that skin. It is really nice removed all the other options except the family setting I changed the filter to only show the path I wanted. It all looked great.... Took my child 4 clicks to stumble into the full movie list "up one level" 3 times then click the top option and you have the full list. Just for fun I went ahead and added the last line to the MySQL view, opened XBMC and the same 4 click took me back to only having the one path as an option.
Kids are curious and telling them don't do that is pretty much saying they are going to. The last thing I want is to walk into their room and find them watching The Green Mile because it has such a harmless title.
The kids are too smart. I suggest actually locking the individual sources at the SMB server itself. XBMC will prompt for password, and I believe you can enter one and not have XBMC remember it. XBMC itself just doesn't have the ability to totally lock something out, so doing it at the SMB server is likely your safest bet.
Ah. Just tried it myself. Thought it would have returned to home going "up a level". That's annoying.
Just messing around with some settings a stumbled across what would help you.
Goto appearance/settings/file lists. Unselect Show parent folder items.
Then when you back out of "family" instead of going up one folder you return to home. :-)