[Pending] - TvPlugin ZapOsd Patch | Page 2

Discussion in 'Submit: code patches (MediaPortal/TV-Server/etc.)' started by Neos, March 6, 2011.

  1. elliottmc
    • Premium Supporter

    elliottmc Retired Team Member

    Joined:
    August 7, 2005
    Messages:
    14,927
    Likes Received:
    4,011
    Gender:
    Male
    Location:
    Cardiff, UK
    Ratings:
    +5,503 / 13
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Hi,

    As I have said, when I have just the default 'all channels' group, I cannot reproduce this problem.

    Do you use DVBLink to access your tuners when you see this problem, or can you see this when DVBLink is not installed?

    Mark


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. jameson_uk
    • Premium Supporter

    jameson_uk Retired Team Member

    Joined:
    January 27, 2005
    Messages:
    7,258
    Likes Received:
    2,228
    Gender:
    Male
    Occupation:
    Data Warehousing Consultant
    Location:
    Birmingham
    Ratings:
    +2,405 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    The IDs are not mutually exclusive and yes this has "developed" this way over time and as with many things it is not ideal.

    This should not matter though as it is the radio and TV columns which are important.

    eg. in GetChannels you have
    Code (Text):
    1. [COLOR=#0000FF][B]if[/B][/COLOR] [COLOR=#006400]([/COLOR]ch[COLOR=#006400].[/COLOR]VisibleInGuide [COLOR=#006400]&&[/COLOR] ch[COLOR=#006400].[/COLOR]IsTv[COLOR=#006400])[/COLOR]
    So even if radio channels did make it here then they would get filtered out (so working by proxy rather than design) but if you go up a little earlier you will see
    Code (Text):
    1. [COLOR=#0000FF][B]foreach[/B][/COLOR] [COLOR=#006400]([/COLOR]GroupMap chan [COLOR=#0000FF][B]in[/B][/COLOR] TVHome[COLOR=#006400].[/COLOR]Navigator[COLOR=#006400].[/COLOR]CurrentGroup[COLOR=#006400].[/COLOR][COLOR=#191970][B]ReferringGroupMap[/B][/COLOR][COLOR=#006400]())[/COLOR]
    ChannelGroup is mapped to the TV group table so IIRC (I don't have a database to check) this can only ever flag return a list of channel IDs that are TV channels.

    My hunch is that if you look at channels table you will see that your radio channels do not have the IsRadio column set but in fact have the IsTV column set?


    also.... MDAPI is pretty stable but highly dependant on choice of software to go with it. This however is not the place to discuss that.
     
  4. Neos

    Neos Portal Member

    Joined:
    February 14, 2008
    Messages:
    18
    Likes Received:
    15
    Ratings:
    +15 / 0
    Home Country:
    Netherlands Netherlands
    You are referring to GetChannels in TVZapOSD? Not to be rude, but that method is obsolete and is not being referenced by the code any more, which is why I deleted it in my patch. My TV guide is completely fine BTW, I have no radio channels in the EPG. Well it was being referenced but the List<> it maintains was not being used. IList<GroupMap> channels = CurrentGroup.ReferringGroupMap(); Gets called to get the current channel group map and thus in-turn the channels.

    So GetChannels does not get called any more hench this might be the reason why the radio channels did not get removed from the channel list.

    PS: Last reply some how my attachment ended up not getting attached, it should be attached to this post; the database dump.
     

    Attached Files:

    • data.zip
      File size:
      5.6 KB
      Uploaded:
      March 10, 2011
      Views:
      122
    • Like Like x 1
  5. jameson_uk
    • Premium Supporter

    jameson_uk Retired Team Member

    Joined:
    January 27, 2005
    Messages:
    7,258
    Likes Received:
    2,228
    Gender:
    Male
    Occupation:
    Data Warehousing Consultant
    Location:
    Birmingham
    Ratings:
    +2,405 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    As I said I am looking at this in a hotel room whilst away on business so can not be sure of things.
    That said GetChannels is called on line 613 of TVHomeNavigator.cs (which you are removing in your patch) so I am fairly sure that this code is currently being run

    I will look at this when I am at home over the weekend
     
    • Like Like x 1
  6. Neos

    Neos Portal Member

    Joined:
    February 14, 2008
    Messages:
    18
    Likes Received:
    15
    Ratings:
    +15 / 0
    Home Country:
    Netherlands Netherlands
    Thanks, let me know if you spot any irregularities.

    I'm not debating the code isn't run, I'm debating the use of the code; it's function in this class. Look at the void GetChannels(bool) method and the global class variable it is using (_channelList). Now is this variable referenced by any other method in TVZapOSD? According to visual studio it isn't, so what does GetChannels actually do? You tell me cause I certainly could not find any use for it (except for confusing developers).

    Ps: Whats with the method naming, GetChannels that returns a void? How does that comply with the best practices? A more appropriate name would have bin RefreshInternalChannelList. As that is what it actually does.
     
  7. jameson_uk
    • Premium Supporter

    jameson_uk Retired Team Member

    Joined:
    January 27, 2005
    Messages:
    7,258
    Likes Received:
    2,228
    Gender:
    Male
    Occupation:
    Data Warehousing Consultant
    Location:
    Birmingham
    Ratings:
    +2,405 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Not sure if it cut off before the end but there is no groupmap table in there which I partly what I wanted to look at. Also this did make me realise that you have some analogue stuff but you did say channel about DVB provider so I guess the issue is not realted to analogue. I have tried a few different tests but I am struggling to find the time to look at this in depth (may be tomorrow) and I just can not get the channel up button on my RC6 remote (I am assuming you are using the standard MCE setting and not some other remote software?)

    A lot of code in MP is leftover from years ago and has been changed so many times it is pretty messy. This makes sense and when I get 10 minutes I will just check and as you say it is likely this can be ripped out alltogether.

    What would be helpful is if you could figure out where in the code radio channels are being picked up.
     
  8. jameson_uk
    • Premium Supporter

    jameson_uk Retired Team Member

    Joined:
    January 27, 2005
    Messages:
    7,258
    Likes Received:
    2,228
    Gender:
    Male
    Occupation:
    Data Warehousing Consultant
    Location:
    Birmingham
    Ratings:
    +2,405 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    OK I have removed the whole GetChannels code in SVN 27652 as this should have been removed in 26014.

    Going to have a look now at why you are getting Radio channels as I am still struggling to find anywhere that radio channels would be picked up
     
    • Like Like x 1
  9. Neos

    Neos Portal Member

    Joined:
    February 14, 2008
    Messages:
    18
    Likes Received:
    15
    Ratings:
    +15 / 0
    Home Country:
    Netherlands Netherlands
    As requested I have attached a dump of the groupmap table.
     

    Attached Files:

    • groupmap.zip
      File size:
      1.6 KB
      Uploaded:
      March 13, 2011
      Views:
      130
  10. jameson_uk
    • Premium Supporter

    jameson_uk Retired Team Member

    Joined:
    January 27, 2005
    Messages:
    7,258
    Likes Received:
    2,228
    Gender:
    Male
    Occupation:
    Data Warehousing Consultant
    Location:
    Birmingham
    Ratings:
    +2,405 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Not got much time this morning again :( but looking at
    Code (Text):
    1. [COLOR=#191970][B]ZapToChannelNumber[/B][/COLOR][COLOR=#006400]([/COLOR][COLOR=#FF0000][B]int[/B][/COLOR] channelNr[COLOR=#006400],[/COLOR] [COLOR=#FF0000][B]bool[/B][/COLOR] useZapDelay[COLOR=#006400])[/COLOR]
    you only have a few things to pickup items from database
    Code (Text):
    1. IList[COLOR=#006400]<[/COLOR]GroupMap[COLOR=#006400]>[/COLOR] channels = CurrentGroup[COLOR=#006400].[/COLOR][COLOR=#191970][B]ReferringGroupMap[/B][/COLOR][COLOR=#006400]();[/COLOR]
    Will only give you records from GroupMap table which can only be TV channels
    Code (Text):
    1. chan = [COLOR=#006400](([/COLOR]GroupMap[COLOR=#006400])[/COLOR]channels[COLOR=#006400][[/COLOR]iCounter[COLOR=#006400]]).[/COLOR][COLOR=#191970][B]ReferencedChannel[/B][/COLOR][COLOR=#006400]();[/COLOR]
    Which picks up a channel from the channel table (and because the channel ID was picked up from GroupMap table this again should only be able to be a TV channel)
    Code (Text):
    1. [COLOR=#0000FF][B]foreach[/B][/COLOR] [COLOR=#006400]([/COLOR]TuningDetail detail [COLOR=#0000FF][B]in[/B][/COLOR] chan[COLOR=#006400].[/COLOR][COLOR=#191970][B]ReferringTuningDetail[/B][/COLOR][COLOR=#006400]())[/COLOR]
    Which is picking up records from TuningDetail table based on channelID (which as above should only ever be a TV channel)

    Then this calls
    Code (Text):
    1. [COLOR=#191970][B]ZapToChannel[/B][/COLOR][COLOR=#006400]([/COLOR][COLOR=#FF0000][B]int[/B][/COLOR] channelNr[COLOR=#006400],[/COLOR] [COLOR=#FF0000][B]bool[/B][/COLOR] useZapDelay[COLOR=#006400])[/COLOR]
    which follows basically the same logic

    I guess any issue is therefore further back and possibly as high as the event handler for user input.

    So if you could confirm how your MCE remote is setup and check the dump of your database for the GroupMap table that would help
     
  11. Neos

    Neos Portal Member

    Joined:
    February 14, 2008
    Messages:
    18
    Likes Received:
    15
    Ratings:
    +15 / 0
    Home Country:
    Netherlands Netherlands
    The remote is setup properly, in my debug config I use the keybord to zap from channel to channel (F7 and F8, if I remember correctly).

    I also did a manual query on the database:
    Code (Text):
    1. SELECT * FROM (groupmap as map) LEFT JOIN channel ON map.idChannel = channel.idChannel ORDER BY map.sortOrder;
    This also returned radio channels, this might be the problem. As you said this table should not contain mappings from radio-channels.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!