Database: Refactor MP1 database for multi seat usage (1 Viewer)

wizard123

Retired Team Member
  • Premium Supporter
  • January 24, 2012
    2,569
    2,680
    Home Country
    United Kingdom United Kingdom
    There will be many people that want this ( including me ) and i see no huge reason why we can not merge into mp if everything tests out ok.
    Might i suggest posting your latest version here for people to test and get some feedback ?
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    Okay. I've posted the software as version 011 and a document about how to start using the app.

    Edit: should have said I posted this change in the first posting of this thread.
     
    Last edited:

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    566
    292
    Home Country
    United Kingdom United Kingdom
    I have posted a new version (1.29.013) to the first post in this thread.

    This update contains the following changes:
    1) A few bug-fixes;
    2) Database rationalization.

    The database changes are as follows:
    1) 'movieinfo' held date fields - lastupdate, dateadded and datewatched. This means that we only hold this information for movies when they should be held for all videos. I have moved dateadded and lastupdate to the 'movie' table and datewatched to the resume table. It seemed to me that datewatched should always have been stored only when movies have been watched and resume seems like the logical place to do that.
    2) 'movie' held information about the watched status. Again, it seems more logical to store watched percent and times watched in the resume table because that data is only relevant when a movie has been watched (which is what the 'resume' table reflects.
    3) 'movie' also contained a watched column - indicating whether a movie has been watched. However, the simple presence of a 'resume' entry for a movie tells us that a movie has been watched. The code now checks whether a resume record exists for a movie with a 'stoptime' greater than zero to return whether a movie has been watched.

    These are the last changes I propose to make to the database and I feel these changes are worth the extra effort involved.

    I recommend that anyone testing the refactored application start again from scratch. However, if you wish to keep your current data, I have provided a script file ('MediaPortalRefactor1.29.013 database changes.sql') containing instructions as to how to manually implement these changes (though I think it would be safer to recreate the Video database from scratch).

    Tony
     

    AdHu86

    Portal Pro
    January 14, 2022
    88
    98
    Berlin
    Home Country
    England England
    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.

    However, the simple presence of a 'resume' entry for a movie tells us that a movie has been watched. The code now checks whether a resume record exists for a movie with a 'stoptime' greater than zero to return whether a movie has been watched.
    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…
     

    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…
    In my refactored version, MP1 always processes resume data (though I believe it always did that) and uses the 'percentage needed to mark video as watched' value to make the screen reflect that a video has been watched (like turning the color of the video name to white or displaying the percentage watched) when the percentage needed is exceeded. Behind the scenes, the database is still reflecting what has actually happened.
    Personally, I set the percent needed value to zero because I always want to know what is actually happening, but the screen will still obey the old rules according to what you set the percentage to.
    I strongly believe that databases should reflect what is actually happening and that, when you want screens to be displaying something else depending upon certain conditions, those conditions should apply to visuals only. This approach can do no harm. Should you suddenly decide that you want to see all of the watched statuses, under my system all you have to do is to set the percent needed to a different value and the screen will show you the real watched status because watched status has been been recorded faithfully as events occurred.

    Tony
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    -
    2) 'movie' held information about the watched status. Again, it seems more logical to store watched percent and times watched in the resume table because that data is only relevant when a movie has been watched (which is what the 'resume' table reflects.
    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
     

    Users who are viewing this thread

    Top Bottom