[confirm] RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen) (1 Viewer)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Re: AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    Mhm but is this still needed? Isn't the IsRecordingProgram now set / flagged in the program database?
    I spent a while looking and I could not get to the bottom of it.... I never found the time to go any deeper as the you end up in a big trail of method calls and these methods are called in more than one place so you need to check everywhere these methods are called.

    If you can figure this out I know there are several people who would be very happy but as it stands this is more of a feature of MP than a bug (ie. it is working just slowly)
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    but 3 minutes is.... let's say not usable :) To program a recording it takes me at the moment 6 minutes. 3 minutes waiting for the screen - then again 3 minutes to update it again.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Re: AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    but 3 minutes is.... let's say not usable :) To program a recording it takes me at the moment 6 minutes. 3 minutes waiting for the screen - then again 3 minutes to update it again.
    This is a combination of you having 21 schedules (not unusual I know) and this program occurring many many times (if it is on four times a day on eight channels and you have two weeks worth of data in the EPG then this is 448 instances of this program). I have a feeling the IsRecordingProgram method then gets called 448x21 times (so 9,408 times) which is where you get the delay

    Not many programs will be like this. Normal programs which do not occurr so often come back in a few seconds (for me anyway with 15 odd schedules)

    How long does it take to return details of a program that only occurs on one channel once a week?
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    i'll try to check this.

    Correct other recordings are a lot faster.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Re: AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    i'll try to check this.

    Correct other recordings are a lot faster.
    The whole scheduling code is in need of a bit of love and attention but this is probably in the realms of too much effort to being too much effort for MP1. MP2 should be a lot faster as there is not all the history we have with MP (I think the issue we did fix was probably hanging round from TVE2)

    I spent several hours working my way through the code without much joy (but I was looking for something different at the time). I did discuss this with the devs and I think we will have to wait for 1.1 (which should be very soon :D) and see whether they want to put the large amount of time into this or whether it will be left as a feature...

    If you are able to find anything which helps then I am sure a patch will be considered for 1.2
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    Here is a patch which solves this issue:
    Code:
    Index: TVProgramInfo.cs
    ===================================================================
    --- TVProgramInfo.cs	(revision 25984)
    +++ TVProgramInfo.cs	(working copy)
    @@ -547,6 +547,7 @@
             }
     
           }
    +
           bool updateCurrentProgram = true;
           anyUpcomingEpisodesRecording = false;
           int activeRecordings = 0;
    @@ -563,15 +564,22 @@
               logo = "defaultVideoBig.png";
             }
     
    -        bool isActualUpcomingEps = actualUpcomingEps.Contains(episode) ;
    +        bool isActualUpcomingEps = actualUpcomingEps.Contains(episode);
             bool isRecPrg = isActualUpcomingEps;
             Schedule recordingSchedule = currentSchedule;
    +
             if (!isActualUpcomingEps)
    -        {          
    -          isRecPrg = IsRecordingProgram(episode, out recordingSchedule, true);        
    +        {
    +          isRecPrg = episode.IsRecording || episode.IsRecordingManual || episode.IsRecordingOnce || episode.IsRecordingOncePending || episode.IsRecordingSeries || episode.IsRecordingSeriesPending;
             }
    +        // IsRecordingProgram isn't equivalent to isRecPrg but it is never true when isRecPrg is false so this speeds up ProgramInfo a lot as
    +        // IsRecordingProgram is only started when isRecPrg is true
             if (isRecPrg)
    -        {          
    +        {
    +          isRecPrg = IsRecordingProgram(episode, out recordingSchedule, true);
    +        }
    +        if (isRecPrg)
    +        {
               if (!recordingSchedule.IsSerieIsCanceled(episode.StartTime, episode.IdChannel))
               {
                 bool hasConflict = recordingSchedule.ReferringConflicts().Count > 0;
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    thanks - the code can be optimized a lot more but i've tried to keep the patch small and simple.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    I'm not shure if we can completely remove the IsRecordingProgram, IsSerieIsCanceled and ReferringConflicts - as we have flags for this stuff in the episode object.
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: RC4 SVN (25965) TvPlugin.TVProgramInfo is still slow (recording screen)

    Just wanted to drop a short "Thank You" here that you take care about this problem, as it is very much reducing WAF on my side also ;-)
     

    Users who are viewing this thread

    Top Bottom