• 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 20
New DB Structure for all libraries + DBs [update 2015 06 13 / Released SQL 1.3]
#91
(2014-09-01, 18:56)m.savazzi Wrote: There is another issue I discovered with CURRENT db structure. The smartplaylist does not work you move the data from MySQL to SQLite.
It appears the query return 0 every time... probably due to Path format.

Can you be more specific? We use smartplaylist with both SQLite and MySQL databases and apart from some RDBMS-specific issues in the SQL support I haven't heard of anything fundamentally wrong.
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
#92
(2014-09-01, 23:01)Montellese Wrote:
(2014-09-01, 18:56)m.savazzi Wrote: There is another issue I discovered with CURRENT db structure. The smartplaylist does not work you move the data from MySQL to SQLite.
It appears the query return 0 every time... probably due to Path format.

Can you be more specific? We use smartplaylist with both SQLite and MySQL databases and apart from some RDBMS-specific issues in the SQL support I haven't heard of anything fundamentally wrong.

Here is what I did:
1) I have 2 test library with NFO files. To make it simple those libraries are under the same Mount on Kodi v:\ -> shared folder.
Library 1: v:\lib1
Library 2: v:\lib2
2) configure advancedsettings.xml to point to the correct DB (put in Mysql for the db or cancel the lines to work with sqlite). Let's start with MySQL
3) add sources to library and specify as scraper the NFO
4) import all content - update library
5) create a smartPlaylist:
Library 1:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Cartoni</name>
    <match>all</match>
    <rule field="path" operator="startswith">
        <value>V:\\Lib1\\</value>
    </rule>
    <order direction="ascending">sorttitle</order>
</smartplaylist>
Library 2:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Toons</name>
    <match>all</match>
    <rule field="path" operator="startswith">
        <value>V:\\Lib2\\</value>
    </rule>
    <order direction="ascending">sorttitle</order>
</smartplaylist>

6) If you navigate to the playlist you'll see the selection of the content. So is working

NOW:
7) configure advancedsettings.xml to point to the other DB. So in my case delete everything so that sqllite DB is created
8) First BUG: library configuration is not held so you need to add (again) sources to library and specify as scraper the NFO
9) import all content - update library
10) BUG navigate the one of the two playlists: EMPTY

This happened to me multiple times. is really annoying.

Not that Playlists ARE shown under Video/playlist menu but they do not work.
Code:
19:40:07 T:2732   DEBUG: Testing path: [000] special://profile/playlists/video/Lib1.xsp
19:40:07 T:2732   DEBUG: Testing path: [001] special://profile/playlists/video/Lib2.xsp

here is the query:
Code:
19:40:04 T:2732   DEBUG: CVideoDatabase::RunQuery took 29 ms for 0 items query: select * from movieview  WHERE ((movieview.strPath LIKE 'V:\\Lib1\\%'))

and this is correct as strPath is like: V:\Lib1\Movie1\

so the correct query should be
Code:
select * from movieview  WHERE ((movieview.strPath LIKE 'V:\Lib1\%'))
If you think I'm useful please use the +/- button to raise my reputation
Reply
#93
Some updates to new model.
1) renamed Kodi 1.0
2) added groups and moved relationship to it
3) access to data is bound to groups while bookmarks are bound to user
4) after some thinking I decided that Movie Sets as well as Albums are assets so I moved them in the Assets hierarchy
5) I added Studio and Labels entities
6) Added fields to Movies, Movie Set, Episode, Season, Show
7) Added Genre, Tags, Subtitles, Language, Video Stream, Audio Stream, Certifications
8) Added common exif info on Pictures to allow search
9) I've decided to have Language associated to Audio and Video streams, not to the assets.
10) updated the structure of person, Role and Role Type. To make it more simple and flexible


I've updated first post with the link.

We should almost be there. If you can look at the model... and let me know if I forgot something or not.

I do not have info on modules and games. Can you help me_

Then I will convert the model in the physical data.
If you think I'm useful please use the +/- button to raise my reputation
Reply
#94
(2014-09-07, 18:22)m.savazzi Wrote: I do not have info on modules and games. Can you help me?
Maybe try contacting garbear of RetroPlayer fame to help you with dummy content for games and ROMs for emulators?
http://forum.xbmc.org/showthread.php?tid=164725

If so also remember to checkout his related work here
http://forum.xbmc.org/showthread.php?tid=127816
http://forum.xbmc.org/showthread.php?tid=126210
Reply
#95
I have a question. Aren't audio and video streams, sizes and subtitles logically connected to files more than episodes, movies etc etc? You can have the same movie in 2 different versions with different resolution, streams and those are infos of the file (or the video), not of the episode itself.
Also maybe we will need a element to distinguish between 2 versions of the same movie where the scraper could write "director's cut" or "theatrical cut"...
Reply
#96
(2014-09-08, 18:43)phate89 Wrote: I have a question. Aren't audio and video streams, sizes and subtitles logically connected to files more than episodes, movies etc etc? You can have the same movie in 2 different versions with different resolution, streams and those are infos of the file (or the video), not of the episode itself.
Also maybe we will need a element to distinguish between 2 versions of the same movie where the scraper could write "director's cut" or "theatrical cut"...

1) This is an excellent point. you are right. I was thinking that XBMC today does not allow to have a single asset in two resolutions/formats... but with the new DB it will be possible. This said in the new DB the two copies of the two movies will be two assets not two files. This because the db structure natively supports multipart movies (1 movie splitted on multiple files), so I cannot bing Video stream, Audio stream, Size to the file itself but to the asset.
To manage the concept of versions I can add a Versions entity so that if we have an asset with 2 versions we can bind them together and you can get them easily from the same query.
I think is the best solution to keep multipart movies as well as multiformat assets

2) This should be done at scraping level, the IMDB and TMDB ids will be different. Also in order for this to work you need to have the shows in different folders (I usually have them movie foo, movie foo (Director's cut)). This is fully supported by the DB.
Then the two movies can be grouped in a movie set (automatically with EMM if signaled in TMDB or if the scraper detects the info) or manually using either Movie Sets or Versions as before.

This should do the trick.

M
If you think I'm useful please use the +/- button to raise my reputation
Reply
#97
But in this way don't you have 2 times the movie in the database with all scraped info with 2 different ids?
Also about the watched status i think should be related to the episode, movie etc etc. It's the episode/movie itself that i watched not the specific file. If i have 2 versions of the file and i watch the first the 2nd should also result watched. Also if you remove a watched episode or movie and then you add it back the asset will be deleted and created so the episode will result unwatched, however since the episode entry won't be deleted the database will already have the watched status.
Reply
#98
At program level you can simply add the details to the first version and copy them to the other or even not copy just leave the second record empty

Watched is associated to the asset so if you watch the Director's cut but not the theatrical movie it will be recorded correctly Smile

If you watch the first the second should not be marked as watched OR if you want to have it watched the program can do it. This is a lot of freedom for Kodi Smile
If you think I'm useful please use the +/- button to raise my reputation
Reply
#99
(2014-09-08, 20:40)phate89 Wrote: But in this way don't you have 2 times the movie in the database with all scraped info with 2 different ids?

(2014-09-08, 22:17)m.savazzi Wrote: At program level you can simply add the details to the first version and copy them to the other or even not copy just leave the second record empty

IMO if a DB design results in (obvious and predictable) duplicate information there is something wrong. In the case of multiple versions of the same movie / asset IMO it makes more sense to detect this situation during library scanning and then linking the new file to the existing movie / asset instead of always retrieving both assets (with different database IDs) and then having to match multiple versions of the same asset every time they are shown in the user interface.

I'm actually working on this with the current DB layout and I added a table that links files to media items and during library scanning it detects "identical media items" (for movies it uses the title and year or imdbid). Then when retrieving all movies you get an item for every version of a media item (with the identical database ID and the identical metadata but with different file details like streams) which you can easily go through and put together all items with the same database ID (no additional complex logic that slows down the listing necessary) into a single item that is then presented like a movie set

(2014-09-08, 20:40)phate89 Wrote: Also about the watched status i think should be related to the episode, movie etc etc. It's the episode/movie itself that i watched not the specific file. If i have 2 versions of the file and i watch the first the 2nd should also result watched. Also if you remove a watched episode or movie and then you add it back the asset will be deleted and created so the episode will result unwatched, however since the episode entry won't be deleted the database will already have the watched status.

(2014-09-08, 22:17)m.savazzi Wrote: At program level you can simply add the details to the first version and copy them to the other or even not copy just leave the second record empty

Watched is associated to the asset so if you watch the Director's cut but not the theatrical movie it will be recorded correctly Smile

If you watch the first the second should not be marked as watched OR if you want to have it watched the program can do it. This is a lot of freedom for Kodi Smile

IMO this is something that should be definable by the user i.e. the user should be able to choose whether watching the standard version of movie X should also mark the director's cut version of the same movie X as watched or not. Therefore it should be linked to the specific file and xbmc/kodi can implement the necessary logic to do it the way the user wants. That "freedom" is not possible if the watched status is linked to the media item / asset.
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
I agree with Montellese
Reply
(2014-09-09, 07:57)Montellese Wrote: IMO this is something that should be definable by the user i.e. the user should be able to choose whether watching the standard version of movie X should also mark the director's cut version of the same movie X as watched or not. Therefore it should be linked to the specific file and xbmc/kodi can implement the necessary logic to do it the way the user wants. That "freedom" is not possible if the watched status is linked to the media item / asset.

But what are the chances it will become an option? Usually small options like this will never go into mainline (and it's probably a good thing).
Btw i agree as i said before about the duplicate movie. Sometimes some sort of duplication is allowed to simplify the db and speed up access but in a media database movie is a major resource and it must be unique. Also it would be great if in the future kodi will not show twice the episode if we have 2 versions of it or we renamed it and not yet clean the database (it happens to me A LOT) and prompt a choice list after but that's probably part of the kodi code more than the db..
Reply
Do not forget that the final plan is synchronization.

Same database ID for multiple media with different path could generate troubles for syncing watched status for the case of different watched status per media quality. (Specially with path translations or direct / indirect access ).
Not talking about remotes that will now have to deal with multiple path for a same ID, that will be complicated like hell to do offline download and sync.

But I'd also avoid the mess of Tv Shows with multiples ID per path with group by name that are well ... Wink

Not sure there's an easy an optimal way to address this without major impacts, like for remotes Player.Open movieid 1, what file start ? Ask on the client ? Need to add the path first needing to ask the user at the remote side ?

Have not yet check the db proposal, but files / path or anything should be the object linked to physical details and description ... And we could use some kinds of collations to link the movies together like sets.
Reply
(2014-09-09, 11:08)phate89 Wrote:
(2014-09-09, 07:57)Montellese Wrote: IMO this is something that should be definable by the user i.e. the user should be able to choose whether watching the standard version of movie X should also mark the director's cut version of the same movie X as watched or not. Therefore it should be linked to the specific file and xbmc/kodi can implement the necessary logic to do it the way the user wants. That "freedom" is not possible if the watched status is linked to the media item / asset.

But what are the chances it will become an option? Usually small options like this will never go into mainline (and it's probably a good thing).
Btw i agree as i said before about the duplicate movie. Sometimes some sort of duplication is allowed to simplify the db and speed up access but in a media database movie is a major resource and it must be unique. Also it would be great if in the future kodi will not show twice the episode if we have 2 versions of it or we renamed it and not yet clean the database (it happens to me A LOT) and prompt a choice list after but that's probably part of the kodi code more than the db..

The support of multiple versions of one media item is certainly coming, as it's absolutely necessary for Montellese work in allowing media from multiple sources being added to the Library. For example you might have the same movie in:

1. HD version in local Library
2. SD version from UnPnP source e.g. tablet
3. Bookmarked in an addon

With Montellese's work from what I understand then all three of the above could be added to the Library.

So the question is then to what to present to the user? From what I understand concept similar to Movie Sets is seen as the best option, so you will see a single item for that movie, select it and you will then be shown the different versions. With Theatrical and Director versions I'm not sure what the plan is, I guess until there's some way for the scraper to support this then it would be similar to the moment with duplicate looking items being shown, but like now I again guess that you might be able rename how they are displayed e.g. "Film - Theatrical Cut" and "Film - Directors Cut".
Reply
Is it the best way to handle them as movie sets? In any view available you will have 3 items with same artwork, same title and only different stream details. Very confusing and not very immediate IMO..
Why not something similar to the bluray playlist selection with movie info? Kodi can compare them and simplify it in "sad version", "hd version" and "addon version".
About director's cut if the scraper supports it it's not hard to search "director's cut" or something like this in the file name but in this case we need a "version" attribute that the scraper can fill with the version name if they find it
Reply
I think we should store additional information in the link from a file to an asset, as we have three situations where one movie might have several files.

A) If we have a 1 on 1 local copy from a UPnP source, there is no need to show two entries. And if one of them is watched, all of the copies should be marked as watched as well. (The link from file to asset should probably containt a foreign key to the original file?)

B) If we have to different versions (uncut versus directors cut) then we should probably show them as a set and if one version is watched, doesn't mean we should automatically mark the other as watched as well (perhabs make it a setting). (The link from file to asset could probbly contain some metadata that is likely to differ: duration/PG rating/Year?!?)

C) The same movie, the same version but different qualites. Is there a need for the user to select the qualities? Just play the highest quality the device can play. Would a user actually prefer SD over a HD? Not sure about 3D vs. non 3D version though. (Don't have a 3D tv)
Reply
  • 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 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