(2015-05-06, 20:06)phate89 Wrote: I started to look at the db. Here's some considerations:
1) The person -> asset relationship is wrong. You don't need to connect the person to the asset with a many-many relationship but the person's role to the asset because without it you know that the person is related to the asset but you don't know what is his role.
I need a many to many as a Person can be an acton on one movie, a director in another one.
Also one asset (i.e. a movie) has multiple persons.
And each person has multiple roles
(2015-05-06, 20:06)phate89 Wrote: 2) In several places you put a table like "assettypes" but there's no need for that. It's a pointless complication because the assettypes are defined by code so whether you decide to store the string version (movie, season, episode etc) or the numeric version they are defined by code and you don't need to store them in the database. Kodi already knows what to search for.
Is needed as the asset is generic. Asset refers to everything a fanart, a game, a movie, an episode.
AssetTypes allows to identify correctly the asset.
AssetTypes should be a table as Kodi can add more types as we go on (i.e. games) so we do not need to change anything there.
(2015-05-06, 20:06)phate89 Wrote: 3) many to many relations between versions and videostream,audiostream and subtitles is pointless. Maybe for subtitles could be useful but I'm not actually sure of that too. A version can have several streams but the stream is related only to that version.
No is needed.
An audio stream is 18K AC3
Another audio stream is 5.1 DTS
Now this two audio streams can be part of multiple movies and a movie can have multiple audio streams.
Thus is a N:M relationship
(2015-05-06, 20:06)phate89 Wrote: 4) I don't understand the purpose of language table. I thought it was the list of possible languages for subtitles and streams and it was pointless (like point 2) but it's different and I don't understand the purpose of it.
Same as above. Language is Italian, English, etc...
so you can have a video track that is in English, a subtitle that is italian,
So...
(2015-05-06, 20:06)phate89 Wrote: 5) assets needs a connection to the artworks. You need to connect art to the version in case the user have more than one version but the most used is the one of the asset.
I think you're right...
(2015-05-06, 20:06)phate89 Wrote: 6) I don't understand the purpose of versionbookmarks.
It was requested in the thread.
Immagine you have Avatar and Avatar Directors Cut. They are two versions of the same asset.
Now you can save bookmarks for Avatar and different Bookmarks for Avatars Directors Cut.
(2015-05-06, 20:06)phate89 Wrote: 7) versionviewed relationships are both wrong. an user can have more versionviewed and a version can have more versionviewed so "versionviewed" needs 2 fields. the first with the version id, the second with the user id (like users favorites)
Not sure I got you.
The viewed state is boolean: yes/no.
The last played minute should be saved in the bookmarks.
Going back to Avatar example I can have viewed Avatar but not Avatar Directors Cut.
Will check if I have not done a mess.
(2015-05-06, 20:06)phate89 Wrote: I think it's too early btw to start to create mysql/sqlite versions. These points are all logical problems that could be solved before to create the actual sql code. Also there are several places where there are tables to avoid redundancy that might add complexity without any tangible advantage.
The most important thing before to move forward is that we need kodi devs opinion if we're going in the right direction...
I agree, I generated them for everyone to be able to access the DB with what they are used too. I will keep working on SQL Express