Skip to content

Commit

Permalink
fill major and minor number for channel in group
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Jan 11, 2018
1 parent cab8839 commit 3200b09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pvrclient-mythtv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,16 +698,14 @@ PVR_ERROR PVRClientMythTV::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR
}

// Transfer the channel group members for the requested group
unsigned channelNumber = 0;
for (PVRChannelList::const_iterator itc = itg->second.begin(); itc != itg->second.end(); ++itc)
{
if (itc->bIsRadio == group.bIsRadio)
{
PVR_CHANNEL_GROUP_MEMBER tag;
memset(&tag, 0, sizeof(PVR_CHANNEL_GROUP_MEMBER));

tag.iChannelNumber = ++channelNumber;
// tag.iSubChannelNumber = ...; TODO: PVR API 5.8.0
tag.iChannelNumber = itc->iChannelNumber;
tag.iSubChannelNumber = itc->iSubChannelNumber;
tag.iChannelUniqueId = itc->iUniqueId;
PVR_STRCPY(tag.strGroupName, group.strGroupName);
PVR->TransferChannelGroupMember(handle, &tag);
Expand Down Expand Up @@ -759,6 +757,8 @@ int PVRClientMythTV::FillChannelsAndChannelGroups()
unsigned int chanid = channel.ID();
PVRChannelItem item;
item.iUniqueId = chanid;
item.iChannelNumber = channel.NumberMajor();
item.iSubChannelNumber = channel.NumberMinor();
item.bIsRadio = channel.IsRadio();
// Store the new Myth channel in the map
m_channelsById.insert(std::make_pair(item.iUniqueId, channel));
Expand Down
2 changes: 2 additions & 0 deletions src/pvrclient-mythtv.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class PVRClientMythTV : public Myth::EventSubscriber, FileConsumer
struct PVRChannelItem
{
unsigned int iUniqueId;
unsigned int iChannelNumber;
unsigned int iSubChannelNumber;
bool bIsRadio;
bool operator <(const PVRChannelItem& other) const { return this->iUniqueId < other.iUniqueId; }
};
Expand Down

0 comments on commit 3200b09

Please sign in to comment.