[Approved] Weekend - Patch (1 Viewer)

bob987

MP Donator
  • Premium Supporter
  • January 25, 2009
    47
    5
    Home Country
    Israel Israel
    This Patch is made to allow MediaPortal to support countries in which the
    working days start on Sunday and not on Monday (Israel for example).

    It is based on V1.0.2 (rev 22555)
    The work was done only on the TVEngine3 part.


    The code is based on two new classes than will handle all of the places in
    which there is a decision about the weekend days.
    The selection of the first day of the week is done in TV server congif ->
    recording page.


    The classes are:
    1) Used by the TvPlugin solution:
    Named- WeekEndTools.cs
    using= MediaPortal.GUI.Library, stored inside- core.dll.
    MediaPortal -> Core -> guilib -> MediaPortal.GUI.Library

    2) Used by the TvLibrary solution:
    Named- TVLibWeekEndTools.cs
    using=TvLibrary.Interfaces, stored inside- TvLibrary.Interfaces.dll
    TvLibrary -> Library-> TVLibrary.interfaces -> interfaces



    TVLibrary
    Add the new UI to select the first working day of the week.
    Update code in:
    Setup GUI -> Setup Tv -> Sections -> TvRecording.cs
    Plugins->ConflictsManager
    Plugins->ScheduledRecordingsHandler.cs
    Setup->TvSchedules.cs
    TVDatabase ->Schedule.cs
    TVDatabase->BusinessLayer.cs
    TVService->Scheduler.cs

    The value of DeltaInWorkingDay is inited from:
    In TvService-> inside Service1.cs (when the service just starts)
    (In TvSetup -> no need)


    TVPlugin
    Update code in:
    TvPlugin -> TVConflicts.cs
    TvPlugin -> TvNewScheduleSearchType.cs
    TvPlugin -> TVPriorities.cs
    TvPlugin -> TVProgramInfo.cs
    TvPlugin -> TVScheduler.cs
    TvPlugin -> TVSearch.cs
    TvPlugin -> TVUtil.cs

    The value of DeltaInWorkingDay is inited from:
    In TvPlugin-> inside TvHome.cs --> init()
    In Database -> TvBusinessLayer -> BusinessLayer.cs (see remark in
    Tvlibweekendtool)


    Also added the needed lines to all of the Language files (except ko & zh-CN
    that were unseen on my PC).

    Bob


    https://forum.team-mediaportal.com/general-development-no-feature-request-he re-48/weekend-patch-60215/
    ********

    Somewhere in the wiki it was written to put the patch inside sourceforge.net, so I opened there a new thread:
    SourceForge.net: MediaPortal: Detail: 2796489 - Weekend - Patch
    If that was a mistake, please tell me an i will delete it.
     

    Attachments

    • WeekEnd.zip
      30.6 KB

    infinite.loop

    Retired Team Member
  • Premium Supporter
  • December 26, 2004
    16,163
    4,133
    127.0.0.1
    Home Country
    Austria Austria
    Somewhere in the wiki it was written to put the patch inside sourceforge.net,
    I thought that i would have updated all the old references to the sourceforge patch section allready, seems that i missed one. :)
    Do you remember which page that was in the wiki?

    Because the patches section on sourceforge will be disabled today/tomorrow, and this forum is then the only location to submit new patches. :)

    :D
     

    bob987

    MP Donator
  • Premium Supporter
  • January 25, 2009
    47
    5
    Home Country
    Israel Israel
    I probably show the old link a little time before you updated the wiki.
     

    bob987

    MP Donator
  • Premium Supporter
  • January 25, 2009
    47
    5
    Home Country
    Israel Israel
    Hi,
    I wish to know if there is some thing that I can do to help this patch get into the production code.

    So for stat, let me say some things about this patch:
    a) The purpose of it is to allow MP to record TV program on every working / weekend days in countries that the weekdays starts on Sunday (or Monday of course).
    b) This makes to code more readable by moving many repeated “if” sentences into two dedicated classes.
    c) This code would help other to very easily add support of the rest of working days kinds used around the world. (Workweek - Wikipedia, the free encyclopedia)
    d) I did extensive tests for the code, and I’m sure that I cleaned all the bugs in it.
    e) I use this code for the past week and a half on my MediaPortal system and it works fine.
    f) And the most important: This will help me record my wife’s daily soap opera show! ;)

    Will be happy to answer any question,
    Bob
     

    misterd

    Retired Team Member
  • Premium Supporter
  • April 4, 2006
    1,597
    314
    Home Country
    Germany Germany
    I have evaluated this patch and will probably soon integrate a modified version. The things I will change are:
    - No WeekendTool in MP itself, as the Plugin can reuse the same code as TVServer uses.
    - As you already mentioned in the code the initialization isn't optimal
    - I want to remove the need for a restart when you change this value.

    :D for the patch anyway.

    MisterD
     

    misterd

    Retired Team Member
  • Premium Supporter
  • April 4, 2006
    1,597
    314
    Home Country
    Germany Germany
    I just added a modified version of the patch. Since the German translation wasn't correct I only added the German and Englisch texts.

    MisterD
     

    bob987

    MP Donator
  • Premium Supporter
  • January 25, 2009
    47
    5
    Home Country
    Israel Israel
    MisterD,

    Happy to see that you approved the code.
    I will take a look on how you fixed my coding problems.

    Don't forget to add the Hebrew language file.
    I also fixed another miss spelling in id 925, so I attach the new file.

    Bob
     

    Attachments

    • string_he.xml.patch.zip
      30.7 KB

    Users who are viewing this thread

    Top Bottom