• 1
  • 2
  • 3(current)
  • 4
  • 5
  • 20
New DB Structure for all libraries + DBs [update 2015 06 13 / Released SQL 1.3]
#31
(2014-08-12, 19:10)Montellese Wrote: Maybe it would be worth looking into DB schemas of other media centres like MediaPortal or MediaBrowser to see how they are doing it.
MeediOS (open source fork of the closed source Meedio) is probably another good example worth looking into then?
http://www.meedios.com/EN/index.php
http://sourceforge.net/projects/meedios/
Reply
#32
if we look at MediaPortal we have to look at MediaPortal2 which has client/server architecture and AFAIK it took them quite long to develop the structure and syncinc logic
Reply
#33
(2014-08-13, 15:16)da-anda Wrote: if we look at MediaPortal we have to look at MediaPortal2 which has client/server architecture and AFAIK it took them quite long to develop the structure and syncinc logic

yes they started from scratch to develop mediaportal 2 without any code or compatibility with the 1.x version trying to do it flexible and powerful so it's a good place to look for ideas.
But I didn't find database schemas for that version
Reply
#34
(2014-08-13, 15:34)phate89 Wrote:
(2014-08-13, 15:16)da-anda Wrote: if we look at MediaPortal we have to look at MediaPortal2 which has client/server architecture and AFAIK it took them quite long to develop the structure and syncinc logic
yes they started from scratch to develop mediaportal 2 without any code or compatibility with the 1.x version trying to do it flexible and powerful so it's a good place to look for ideas.
But I didn't find database schemas for that version
Without digging into the source code these are the only references about a basic concept behind the database schema in MediaPortal2

http://www.team-mediaportal.com/team-blo...ess-report
http://www.team-mediaportal.com/team-blog/extensible

Overview

"Dedicated client / server architecture - The MediaPortal 2 Server is responsible for the central management of all media. You can connect multiple clients to the server and across all those clients you get the same data. Besides the media files itself, this also includes the meta data like genre, summary, actors, as well as the play count, watched state and last time a media has been played. As a result the client is just that - a client to browse and play content from the server. You can just hook up a new computer with the MediaPortal 2 Client installed, connect to the server, and you are just about ready to go! Of course you can still use one computer for both client and server. There is no graphical user interface (GUI) available when running the server only, but you can always monitor the status of the server from the system tray."

and they go on to say

"MediaLibrary - The MediaPortal 2 MediaLibrary provides a flexible database to store all kinds of metadata of media items like information from ID3 tags, video metainformation about movies, TV channels and EPG data, for example. It also stores metadata to all shares which are available in the system. The access to the media library is done on a high-level abstraction layer. We use an abstraction concept called „media item aspects“ throughout the application to flexibly store metadata for videos, music files and other media items."

then maybe mentions what is more relevant here

"Database engine - To store the contents of the media library and other data from plugins, the MediaPortal 2 server provides a database interface where each plugin can install its own subschema. The system automatically tracks database schema scripts, schema updates and uninstallation of subschemas. Furthermore, it is possible to exchange the database engine by another one."

and more specifically in regards to client–server model the same article also mentions this

"UPnP library - The MediaPortal 2 system uses the UPnP protocol to communicate. Since the only public available UPnP library for .net was the library from Intel and that one was quite old, buggy and not available as source code when we started, we decided to develop our own library. Now, we can proudly present our fully functional, well-designed and stable UPnP library.
In the meantime, Intel has reworked their library to a new version which also supports the UPnP 1.1 protocol, but our library is still better
"

MediaPortal 2 still uses SQLite as its default database even if it still supports others
Reply
#35
While permissions by rating would rock, an easier method may just be by source path. That way, you could do the following:

Movies/mature/teen/child: where different profiles would have access to either mature and everything below, teen and everything below, or just child.

Or
movies/mature
Movies/teen
Movies/child

Someone built a sweet work around with the user in advancedsettings.Xml being the main differentiator. So instead of just 'xbmc', you had the user be the profile. Allowed folder permissions as well as profile specific resume and bookmarks! Just seemed cludgy to implement, but how cool is that?

Log into any box in the home, and you have your favorites, resumes, and bookmarks. That's freaking sweet.
Reply
#36
(2014-08-13, 17:07)RockerC Wrote:
(2014-08-13, 15:34)phate89 Wrote:
(2014-08-13, 15:16)da-anda Wrote: if we look at MediaPortal we have to look at MediaPortal2 which has client/server architecture and AFAIK it took them quite long to develop the structure and syncinc logic
yes they started from scratch to develop mediaportal 2 without any code or compatibility with the 1.x version trying to do it flexible and powerful so it's a good place to look for ideas.
But I didn't find database schemas for that version
Without digging into the source code these are the only references about a basic concept behind the database schema in MediaPortal2

http://www.team-mediaportal.com/team-blo...ess-report
http://www.team-mediaportal.com/team-blog/extensible

Overview

"Dedicated client / server architecture - The MediaPortal 2 Server is responsible for the central management of all media. You can connect multiple clients to the server and across all those clients you get the same data. Besides the media files itself, this also includes the meta data like genre, summary, actors, as well as the play count, watched state and last time a media has been played. As a result the client is just that - a client to browse and play content from the server. You can just hook up a new computer with the MediaPortal 2 Client installed, connect to the server, and you are just about ready to go! Of course you can still use one computer for both client and server. There is no graphical user interface (GUI) available when running the server only, but you can always monitor the status of the server from the system tray."

and they go on to say

"MediaLibrary - The MediaPortal 2 MediaLibrary provides a flexible database to store all kinds of metadata of media items like information from ID3 tags, video metainformation about movies, TV channels and EPG data, for example. It also stores metadata to all shares which are available in the system. The access to the media library is done on a high-level abstraction layer. We use an abstraction concept called „media item aspects“ throughout the application to flexibly store metadata for videos, music files and other media items."

then maybe mentions what is more relevant here

"Database engine - To store the contents of the media library and other data from plugins, the MediaPortal 2 server provides a database interface where each plugin can install its own subschema. The system automatically tracks database schema scripts, schema updates and uninstallation of subschemas. Furthermore, it is possible to exchange the database engine by another one."

and more specifically in regards to client–server model the same article also mentions this

"UPnP library - The MediaPortal 2 system uses the UPnP protocol to communicate. Since the only public available UPnP library for .net was the library from Intel and that one was quite old, buggy and not available as source code when we started, we decided to develop our own library. Now, we can proudly present our fully functional, well-designed and stable UPnP library.
In the meantime, Intel has reworked their library to a new version which also supports the UPnP 1.1 protocol, but our library is still better
"

MediaPortal 2 still uses SQLite as its default database even if it still supports others

Maybe http://wiki.team-mediaportal.com/2_MEDIA...ata_system and its subpages provide detailed information.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#37
If you guys are revamping the database, can i humbly request that you use meaningful field names. EG the movie table in the current videos78 database has fields

idMovie, c00, c01, c02...

Not very intuitive I'm afraid.
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
#38
Hi,

the recent priorities, and I think one of the goals of the new scheme, is to make smart playlists more and more powerful, so user can create their own library nodes, skins can show content in some sort of widget on the homescreen etc. So, why don't we reuse that power and implement some sort of "Rules based acces control" .
By that I mean that every profile has a Smartplaylist associated, and only content that would fit into that smartplaylist is displayed (if someone has no smartplaylist associated, he can view everything).

Parents who want to make sure their kids cannot prevent kodis parental control, could move the not allowed content to a PW protected share and assign their kids a smartplaylist that only shows content from the public share.

Parents who want things to be automatic could create a smartplaylist that only shows content with a rating of PG-13, PG-12 etc... (don't know the US rating).
You could even improve on that and make a smartplaylist where parents could manually allowing a movie by adding the 'allowed' tag to it, or manually disallowing it by adding a 'disallowed'.
Code:
((rating==PG-13 AND NOT tag==disallowed) OR tag==allowed)

This ofc heavily depends on how the future DB schema handles smartplaylists and how performant it would be to filter by them on each and every view, but reusing their power and flexibility might be a nice idea.
Reply
#39
(2014-08-12, 12:02)da-anda Wrote: One of the next things he likes to refactor/cleanup are the profiles and especially the permission handling and content filtering. So if we can come up with a good idea/solution on how to handle access to media and everything related (genres, actors, ..) for profiles, Jonathan could refactor in that direction.
One annoying thing about Profiles & the way the database is currently implemented, is that it doesn't cater well for a multi-user environment.

Currently you can either have:

a. Profiles which have separate databases so each profile can have it's own watched status etc, however the downside of this is that metadata needs to be scraped for each profile.

or

b. Profiles which share the master database so metadata is only scraped the once, however it's then not possible to have separate watched status for each Profile.

The ideal solution in my opinion would be:

1. Profiles are assigned the sources that they will be allowed to access along with a permission level.
2. Metadata is scraped the once so a single metadata store is always maintained and can be initiated by any Profile that has permission, thus metadata is shared between all profiles that have access to a particular source.
3. Each profile to be configurable as to whether user actions should be tracked on a per profile basis, so for example the database could assign watched status per profile.
Reply
#40
(2014-08-14, 03:09)nickr Wrote: If you guys are revamping the database, can i humbly request that you use meaningful field names. EG the movie table in the current videos78 database has fields

idMovie, c00, c01, c02...

Not very intuitive I'm afraid.

but very functional. fields can be repurposed without renaming them. if a dynamic db is wanted, this part will only get worse.
Reply
#41
@jjd-uk : watched status goes with resume point, that are for the moment tied to bookmarks.

Not sure how / what purpose the bookmarks handle besides resume point but the other use case may also need to be tied to profiles.
Reply
#42
(2014-08-14, 16:12)Tolriq Wrote: @jjd-uk : watched status goes with resume point, that are for the moment tied to bookmarks.

Not sure how / what purpose the bookmarks handle besides resume point but the other use case may also need to be tied to profiles.

Watched status was only meant to be one example, for sure resume points, bookmarks and other stuff like that should have the ability to be set on a per profile basis in the database, whilst keeping a single metadata (by that I mean posters, movie info etc) store.
Reply
#43
Well yes but I prefer to add a reminder, as for watched status in previous post there's was a good proposal about a "log" table to handle this particular thing.

So listing what should be tied to profile or not or both may be a good start Smile Anyway since I repeat myself I'll stop but defining the target shows the path, building a path without target have few chance to arrive to correct target Wink
Reply
#44
I'm back from my small break with the family and will get back to work on this.

It's great to see all this ideas coming out... will try to factor them in the model and will look to MediaPortal.
If you think I'm useful please use the +/- button to raise my reputation
Reply
#45
Please take a look at the MediaBrowser schema too...

xnappo
Reply
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 20

Logout Mark Read Team Forum Stats Members Help
New DB Structure for all libraries + DBs [update 2015 06 13 / Released SQL 1.3]3