[Pending] TvPlugin ZapOsd Patch (1 Viewer)

elliottmc

Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    United Kingdom United Kingdom
    Country flag
    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
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    United Kingdom United Kingdom
    Country flag
    Note: I see now both my channel groups for radio and TV have group id 1... but why are there two tables it's confusing and error-prone if these tables can't share ids.

    Update: I just did a clean install of the TV server, checked the database there was one group for tv channels in the database: All Channels (ID:1). And no groups for radio channels (not even the All Channels group). I added one internetradio stream, as expected it now created an All Channels group in the radiochannelgroup database: All Channels (ID:1). Clearly this group also had ID 1 which it should NOT, from this little expirence I conclude that TV and Radio channel groups do not have mutually exclusive ID's.
    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:
    [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:
    [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.
     

    Neos

    Portal Member
    February 14, 2008
    18
    15
    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.
     

    Attachments

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    United Kingdom United Kingdom
    Country flag
    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.
    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

    PS: Last reply some how my attachment ended up not getting attached, it should be attached to this post; the database dump.
    I will look at this when I am at home over the weekend
     

    Neos

    Portal Member
    February 14, 2008
    18
    15
    Netherlands Netherlands
    I will look at this when I am at home over the weekend
    Thanks, let me know if you spot any irregularities.

    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'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.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    United Kingdom United Kingdom
    Country flag
    Thanks, let me know if you spot any irregularities
    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?)

    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.
    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.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    United Kingdom United Kingdom
    Country flag
    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
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    United Kingdom United Kingdom
    Country flag
    Not got much time this morning again :( but looking at
    Code:
    [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:
    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:
    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:
    [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:
    [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
     

    Neos

    Portal Member
    February 14, 2008
    18
    15
    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:
    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.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    Top Bottom