Database: Refactor MP1 database for multi seat usage (2 Viewers)

Anthony Vaughan

MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    @Anthony Vaughan
    How about Watched Count?
    And I understand that there is no automatic database update anymore?
    The watched count is stored in the timeswatched field. All I have done is to move it to the resume table.

    What do you mean about no automatic database update anymore?

    Tony
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    -

    You use the term "movie" in your post, but I just wanted to confirm that you actually mean "any file that has a video file extension". So this would include TS, DVR-MS, WTV, plus all of the other file extensions listed in "MP Config". Also...

    I hope that "movie" includes video files that contain only audio, such as radio recordings from DVB-T/T2 and DVB-S/S2 (which have a file extension of TS).

    Note: MP does not currently remember the resume point for radio recordings in the "Videos" section, but I believe that that was because the MediaInfo tool used originally did not return the necessary information. I think that the version used now does return the necessary information, so this could be added in a future change provided that the database structure supports this.

    -- from CyberSimian in the UK
    Sorry, I could have been more clear. All video information is stored in a table called 'movie'. This table stores information about any kind of video; i.e. any allowed extension. There is also a 'movieinfo' table that stores information about films and is linked to the movie table. The dateAdded and lastupdate fields were stored in movieinfo and I moved them to movie so that we know when all videos were updated - not just films.

    The refactored version should do everything it used to do except that it has a multi-user database.

    MP1 doesn't handle radio recordings as well as it handles video recordings and I ended up writing my own radio player a couple of years ago - before I started to look at MP1 code. I haven't really looked at the radio code yet. I guess I could have a look at making radio processing mirror video processing at some time in the future though.

    In the meantime, I will have a look at what currently happens to radio playback and get back to you.
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    I installed MP1 once and directly jumped to MP2 because of a bunch of inconsistencies in MP1. So I apologize, if I missed something below related to MP1.


    I do not think resume represents watched at all. Watched means fully watched and not partly. In MP2 I have „partly watched“ and „watched“ indicators. 0<Playstate<90% partly watched and >90% is fully watched, because you usually do not watch the end credits until the end. I think the 90% can be even configured. I’m sure that something similar should be also present in MP1…
    Just so you know, MP1 sets this here:

    1644865211277.png


    I spent quite a bit of time looking at MP2 and decided to use MP1 for the following reasons:
    1) I find MP1's screens more user friendly (I think the user interface is more rounded). For example, I really like the way you can cycle around the available channels where MP2 stops at BBC One;
    2) MP2 has a central configuration option - meaning that I can have one set-up for all clients. With MP2, you have to manually set-up each client individually.

    These two points were deal breakers for me. I guess that, because MP1 has been around for much longer than MP2, users have had more time to get their user requests processed and I think the GUI reflects that.

    The reason I produced the refactored version was to make the back-end for MP1 multi-user - which, for me, was MP1's major weakness. I hope that this weakness has been now been eradicated giving MP1 a better future.

    I had to re-write pretty much the whole back-end to achieve this and this involved writing/changing thousands of lines of code. Therefore, I think it will need thorough testing before it can be released. I mention this because, so far, I have not received any feedback regarding release 1.29.012 and, therefore, have no idea how people are getting on with it.

    I have been using 1.29.013 for several months with only very minor errors but that is only me using MP1 the way I use it. I think we need a good deal of feedback before we can have any idea as to whether it is ready for release - and that is without integrating the third-party software that may not work anymore. But there is no point in doing that until we have got the main product and the fanart handler ratified.

    Sorry about the rant but this needs to be actioned if we are to move forward with this.
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    -

    You use the term "movie" in your post, but I just wanted to confirm that you actually mean "any file that has a video file extension". So this would include TS, DVR-MS, WTV, plus all of the other file extensions listed in "MP Config". Also...

    I hope that "movie" includes video files that contain only audio, such as radio recordings from DVB-T/T2 and DVB-S/S2 (which have a file extension of TS).

    Note: MP does not currently remember the resume point for radio recordings in the "Videos" section, but I believe that that was because the MediaInfo tool used originally did not return the necessary information. I think that the version used now does return the necessary information, so this could be added in a future change provided that the database structure supports this.

    -- from CyberSimian in the UK
    I've just had a look at recording radio programs and playing them back and that seems to work properly now - remembering where it left off and how many times you have listened to the program. This is all being handled in the main SQL database and doesn't need any further action so far as I can tell.

    So, radio stuff is not being stored anywhere in the client side databases that I can see.
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,879
    1,807
    Southampton
    Home Country
    United Kingdom United Kingdom
    I've just had a look at recording radio programs and playing them back and that seems to work properly now
    The "Recorded Radio" panel does already remember the resume point. However...

    As soon as one accumulates a large number of radio recordings, the "Recorded Radio" panel is no longer adequate to store them. The place where radio recordings can be arranged in the fashion preferred by the user is the "Videos" section of MP. Unfortunately, in MP 1.29 the "Videos" section does not remember the resume point for audio-only files that have a video file extension (such as DVB-T radio recordings).

    In case it is thought that "Videos" is a strange place to store audio files, I should point out that the name of this section in MP is contained in the language strings file, which can be customised by the user to be whatever he prefers. So this section could just as easily be called "Media Library", which one could very reasonably expect to contain both video and audio files.

    -- from CyberSimian in the UK
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    The "Recorded Radio" panel does already remember the resume point. However...

    As soon as one accumulates a large number of radio recordings, the "Recorded Radio" panel is no longer adequate to store them. The place where radio recordings can be arranged in the fashion preferred by the user is the "Videos" section of MP. Unfortunately, in MP 1.29 the "Videos" section does not remember the resume point for audio-only files that have a video file extension (such as DVB-T radio recordings).

    In case it is thought that "Videos" is a strange place to store audio files, I should point out that the name of this section in MP is contained in the language strings file, which can be customised by the user to be whatever he prefers. So this section could just as easily be called "Media Library", which one could very reasonably expect to contain both video and audio files.

    -- from CyberSimian in the UK
    I've played around with this and I see what you mean.

    The recorded radio program gets placed in 'Recorded TV' but doesn't seem to be treated like a video file when you try to open it using the Video component. Off the top of my head, because I haven't looked at the code yet, but from memory I think this is probably being caused because the code checks for the content of the file to try to work out what to do with it rather than just looking at the extension. I have experienced similar issues with .wtv files which don't get thumbnails to the left of the program name, ever, but do get placed in 'movieinfo' but only after you scan the file. The value of the duration of a .wtv file can also only be obtained by scanning the file.

    I have sort of accepted this limitation and tended to convert my files to .ts when accessing them through MP (to get consistent behavior for all of my videos).

    Anyway, when opened in Recorded TV, audio files are placed in the Video database, in the movie table, but no resume record is generated when the audio file is played.

    I'll have a look at whether there is any barrier to making audio files be treated like video files when accessed in this way and I'll get back to you.

    Tony
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,879
    1,807
    Southampton
    Home Country
    United Kingdom United Kingdom
    I think we need a good deal of feedback before we can have any idea as to whether it is ready for release
    I copied my production partition to some unused space on my disk, and installed the updates in the partition copy:

    (1) The first time that I ran the BAT file I got numerous "not authorised" errors from around half of the COPY lines in the BAT file :( . So I gave up with that and copied my production partition again.

    (2) I tried installing once more, but this time I first stopped TV Server, deleted the existing databases, and then opened a command window with administrator privileges and ran the BAT file from that. This worked without error. :)

    (3) I rebooted and started "MP Config", but did not change any settings, as there did not seem to be anything that needed changing for my setup.

    (4) I then started MP and displayed the "TV Guide" panel, the "Recorded TV" panel, and the "Recorded Radio" panel. This all worked without problem.

    (5) Then I displayed the "Videos" panel, and on entering one of the folders, the spinning dial appeared and never disappeared (I waited about 20 minutes). "Resource Monitor" indicated that there was CPU, network, and disk activity for the entire 20 minutes, although my broadband router did not indicate any activity, so I don't think that it was accessing the internet.

    (6) MP logs attached.

    -- from CyberSimian in the UK
     

    Attachments

    • dblog1.zip
      40.6 KB

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,941
    2,018
    South of France
    Home Country
    France France
    I think the 90% can be even configured. I’m sure that something similar should be also present in MP1…
    Hello,
    If you want to be more sharp IRL (In the Real Life), 95% is better than 90%, for movies and series....
    May be this could be the default in MP or others plugins ?
     

    AdHu86

    Portal Pro
    January 14, 2022
    88
    98
    Berlin
    Home Country
    England England
    1) I find MP1's screens more user friendly (I think the user interface is more rounded).
    For me it’s vice versa, I found >20 fundamental issues in 1 hour of MP1 usage. Hardcoded design elements, that are just empty without function, if the plugins are not installed (MP2 knows which plugins installed and all elements for non existent plugins are invisible). The player controls show buttons, even the function is not given. MP2 shows only buttons that also can be used. …
    Some skins have color elements that are painful (orange with blue etc., in my company there is even a guideline not allowing such combinations) and totally overloaded with information. It seemed a designer tried to squeeze infos into every free space. Ares was the only skin, that looked for me ok, but had other issues. Anyway, I don’t want to start a bashing against MP1 here. It’s just to explain my experience. Im very happy with MP2. It works stable on 3 clients.

    For example, I really like the way you can cycle around the available channels where MP2 stops at BBC One;
    There is a loop scrolling setting, which allows loop scrolling in almost all screens. But I think you’re right, in the main EPG it’s not possible. I think it’s because you can otherwise not reach some elements placed above the EPG. But this can be also easily changed. Change LoopScrolling=“False” to “True” in the xaml file of the EPG screen :)

    2) MP2 has a central configuration option - meaning that I can have one set-up for all clients. With MP2, you have to manually set-up each client individually.
    MP2 offers user management and if activated all settings are shared. I can start watching my movie in the kitchen and if I log in in the bed room with my user I can resume it there.

    Hello,
    If you want to be more sharp IRL (In the Real Life), 95% is better than 90%, for movies and series....
    May be this could be the default in MP or others plugins ?
    Agree, but in the end it depends also very much on the video length. For episodes and short movies 90% might be better, for longer movies probably 95%. In the end it can be configured for MP1 and MP2, so I’m fine :)
     
    Last edited:

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    Hi CyberSimian

    Thank you for trying the refactored version and giving me feedback.

    Are you installing this on a separate machine (VPN)? We need to start with a fresh install of MP1 (1.29) using the production install executable and then copy the new files over that installation by running RefactorMediaPortal.bat as administrator. Now, delete the databases. When you run the configuration app or the GUI the databases should be created automatically. You will know if you've got it right if the video database is called VideoDatabaseV6.db3 and the music database should be MusicDatabaseV15.db3. The fanart database will have a version of 5.0 in the 'param' table. If you have autostart MPTray running in the toolbar then you should close it first because this version upgrades Utils.dll and MPTray locks this DLL.

    I got the perpetual spinning dial when the wrong version of the database is loaded. So I suspect that you need to check that first. So make sure you follow the steps in the above paragraph rather than copying your current installation. You need to do this because this release is so extensive that, for testing, I think we need to start from scratch with clean databases and I can work on upgrading existing databases when I am sure that the product is working for everyone. You will see the database being populated as you work through the functionality.

    You can install the attached free SQLite database browser to look at the database contents.
     

    Attachments

    • DB.Browser.for.SQLite-3.12.2-win64.msi
      17.2 MB

    Users who are viewing this thread

    Top Bottom