std::vector<std::shared_ptr<CPVREpgInfoTag>> CPVRChannel::GetEpgTags() const { const CPVREpgPtr epg = GetEPG(); if (!epg) { CLog::LogFC(LOGDEBUG, LOGPVR, "Cannot get EPG for channel '%s'", m_strChannelName.c_str()); return {}; } return epg->GetTags(); }
std::vector<std::shared_ptr<CPVREpgInfoTag>> CPVRChannelGroup::GetEPGAll(bool bIncludeChannelsWithoutEPG /* = false */) const { std::vector<std::shared_ptr<CPVREpgInfoTag>> tags; CPVREpgInfoTagPtr epgTag; CPVRChannelPtr channel; CSingleLock lock(m_critSection); for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_iterator it = m_sortedMembers.begin(); it != m_sortedMembers.end(); ++it) { channel = (*it).channel; if (!channel->IsHidden()) { bool bEmpty = false; CPVREpgPtr epg = channel->GetEPG(); if (epg) { const std::vector<std::shared_ptr<CPVREpgInfoTag>> epgTags = epg->GetTags(); bEmpty = epgTags.empty(); if (!bEmpty) tags.insert(tags.end(), epgTags.begin(), epgTags.end()); } if (bIncludeChannelsWithoutEPG && bEmpty) { // Add dummy EPG tag associated with this channel if (epg) epgTag = std::make_shared<CPVREpgInfoTag>(epg->GetChannelData(), epg->EpgID()); else epgTag = std::make_shared<CPVREpgInfoTag>(std::make_shared<CPVREpgChannelData>(*channel), -1); tags.emplace_back(epgTag); } } } return tags; }