Help with a patch (1 Viewer)

mcraenz

MP Donator
  • Premium Supporter
  • July 28, 2007
    647
    46
    Auckland
    Home Country
    New Zealand New Zealand
    As per the this thread I started:
    https://forum.team-mediaportal.com/tuning_details_driving_me_crazy-t28389.html

    I've dug into the code; I've dabbled in c# a little so please bare with me.
    I've SVN'd the latest TV3 code and found where the issue is. As it stands the decision as to whether to update the tuning details or create new ones is based on whether tuning details for the channels exist or not.

    I've created a patch for CardDvbS.cs so that it not only checks whether the tuning details exist but whether they are of the same type or not (dvbs, dvbt etc).

    patch looks like this:

    Code:
    Index: CardDvbS.cs
    ===================================================================
    --- CardDvbS.cs	(revision 16000)
    +++ CardDvbS.cs	(working copy)
    @@ -816,7 +816,7 @@
               Channel dbChannel;
               DVBSChannel channel = (DVBSChannel)channels[i];
               TuningDetail currentDetail = layer.GetChannel(channel);
    -          if (currentDetail == null)
    +          if (currentDetail == null || currentDetail.ChannelType != 3)
               {
                 //add new channel
                 exists = false;
    @@ -827,6 +827,7 @@
                   dbChannel.SortOrder = channel.LogicalChannelNumber;
                 }
               }
    +          
               else
               {
                 exists = true;
    @@ -850,7 +851,7 @@
               {
                 layer.AddChannelToGroup(dbChannel, channel.Provider);
               }
    -          if (currentDetail == null)
    +          if (currentDetail == null || currentDetail.ChannelType != 3 )
               {
                 channel.SatelliteIndex = position;// context.Satelite.IdSatellite;
                 layer.AddTuningDetails(dbChannel, channel);

    So now it will not update the tuning details if the channel type is different.

    I've compiled setuptv and tested.ok

    Now my questions are these:
    1.Where do I look to find all the channel types so that I can create patches for CardDvbt.cs, CardDvbC.cs etc.?
    2.How do I submit my patch?
    3.Will any one implement my patch?
    4.Do I not know what I'm doing and should I just go back to what I know (watching the TV:(!!)?

    Regards,
    mcraenz
     

    mcraenz

    MP Donator
  • Premium Supporter
  • July 28, 2007
    647
    46
    Auckland
    Home Country
    New Zealand New Zealand
    I'll answer my own questions:
    1.BusinessLayer.cs
    2.Sourceforge.net (Dur!)
    3.How the hell should I know?
    4.Leave that to the devs to judge.

    Btw, the patch I submitted is different (better) than the above. :D
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    It's always nice to see the common user fixing stuff in MP.

    Lets have a look at it, could U PM me the sources, or post them here.
    Then I will review it.

    /Gibman
     

    mcraenz

    MP Donator
  • Premium Supporter
  • July 28, 2007
    647
    46
    Auckland
    Home Country
    New Zealand New Zealand
    Hey Gibman, Thanks for taking an interest. I hope I don't end up wasting your time.

    I'm only a self taught C# coder and I've only been dabbling in bits and pieces in the last couple of years. I'm a windows system admin and normally I just code as much as I need to (Admin tools / scripts) The only other thing I've done in MP is the parallel port plugin:
    https://www.team-mediaportal.com/files/Download/Plugins/Utilities/ParallelPortPowerControl/

    I'm really keen to try to do more bugfixes and I know the team are always calling out for help I guess when you're self taught it's hard to judge whether you have enough skill to contribute or if you're just going to end up causing trouble for the real devs.

    Anyways on to the patch....I've posted the changed source files on sourceforge:
    http://sourceforge.net/tracker/index.php?func=detail&aid=1800466&group_id=107397&atid=647927

    If you compare them against SVN 16014 you'll see the changes.

    Cheers,
    mcraenz
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    It's in SVN :)
    nice and cozy like.

    I altered it a bit, check SVN for info (only changed businesslayer.cs).

    /Gibman
     

    mcraenz

    MP Donator
  • Premium Supporter
  • July 28, 2007
    647
    46
    Auckland
    Home Country
    New Zealand New Zealand
    :D :D Awesome Gibman! Thanks so much for taking the time. I was trying to think of a way of doing what you did but I thought it couldn't be done because the channel that was being passed to GetChannel was a of type DVBBaseChannel and not a specific type(Dvbt,dvbs etc) of channel?

    Should I take this as encouragement to continue bug finding? Because there is a bug in episode management which I think I've nearly found ;-)?

    ===Update===
    Just installed the latest SVN and started off with a fresh DB everything works exactly as it should.
    Thanks again Gibman, you've really made my day.
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    Hi mcraenz !

    We sure DO appreciate all the help we can get.
    The best kind of donation there is.

    So in other words "keep it coming" :)

    /Gibman
     

    Users who are viewing this thread

    Top Bottom