mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
make channel_id private, use getChannelID()
This commit is contained in:
@@ -830,13 +830,13 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann
|
||||
|
||||
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
|
||||
CChannelEvent *event;
|
||||
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
|
||||
event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()];
|
||||
|
||||
if (event) {
|
||||
int percentage = 100;
|
||||
if (event->duration > 0)
|
||||
percentage = 100 * (time(NULL) - event->startTime) / event->duration;
|
||||
CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo);
|
||||
CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo);
|
||||
timestr = timeString(event->startTime);
|
||||
|
||||
firstEPG += hh->outPair("startTime", timestr, true);
|
||||
@@ -855,7 +855,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann
|
||||
}
|
||||
}
|
||||
|
||||
result += hh->outPair("isActiveChannel", (channel->channel_id == current_channel) ? "true" : "false", (!firstEPG.empty()));
|
||||
result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", (!firstEPG.empty()));
|
||||
if(!firstEPG.empty()) {
|
||||
result += hh->outCollection("firstEPG", firstEPG);
|
||||
}
|
||||
@@ -873,10 +873,10 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel *
|
||||
bool isEPGdetails = !(hh->ParamList["epg"].empty());
|
||||
if (hh->outType == json || hh->outType == xml) {
|
||||
result += hh->outPair("number", string_printf("%u", nr), true);
|
||||
result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->channel_id), true);
|
||||
result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->channel_id&0xFFFFFFFFFFFFULL), true);
|
||||
result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true);
|
||||
result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()&0xFFFFFFFFFFFFULL), true);
|
||||
result += hh->outPair("name", hh->outValue(channel->getName()), true);
|
||||
result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->channel_id)), true);
|
||||
result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())), true);
|
||||
result += hh->outPair("bouquetnr", string_printf("%d", bouquetNr), isEPGdetails);
|
||||
if(isEPGdetails)
|
||||
result += _GetBouquetActualEPGItem(hh, channel);
|
||||
@@ -884,21 +884,21 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel *
|
||||
}
|
||||
else {
|
||||
CChannelEvent *event;
|
||||
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
|
||||
event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()];
|
||||
|
||||
if (event && isEPGdetails) {
|
||||
result += string_printf("%u "
|
||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
" %s (%s)\n",
|
||||
nr,
|
||||
channel->channel_id,
|
||||
channel->getChannelID(),
|
||||
channel->getName().c_str(), event->description.c_str());
|
||||
} else {
|
||||
result += string_printf("%u "
|
||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
" %s\n",
|
||||
nr,
|
||||
channel->channel_id,
|
||||
channel->getChannelID(),
|
||||
channel->getName().c_str());
|
||||
}
|
||||
}
|
||||
@@ -1294,7 +1294,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) {
|
||||
|
||||
for (int j = 0, csize = (int) channels.size(); j < csize; j++) {
|
||||
CZapitChannel * channel = channels[j];
|
||||
res_channels += hh->outArrayItem("channel", channelEPGformated(hh, j + 1, channel->channel_id, max, stoptime), j<csize-1);
|
||||
res_channels += hh->outArrayItem("channel", channelEPGformated(hh, j + 1, channel->getChannelID(), max, stoptime), j<csize-1);
|
||||
}
|
||||
if(all_bouquets) {
|
||||
res_channels = hh->outPair("number", string_printf("%d", i + 1), true) +
|
||||
@@ -1355,7 +1355,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat )
|
||||
std::vector<t_channel_id> v;
|
||||
int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio
|
||||
for(int channel = 0; channel < channel_nr; channel++){
|
||||
channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id;
|
||||
channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->getChannelID();
|
||||
v.push_back(channel_id);
|
||||
}
|
||||
std::map<t_channel_id, t_channel_id> ch_id_map;
|
||||
@@ -1491,15 +1491,15 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) {
|
||||
CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin();
|
||||
for (; !(cit.EndOfChannels()); cit++) {
|
||||
CZapitChannel * channel = *cit;
|
||||
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
|
||||
event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()];
|
||||
if (event) {
|
||||
if (!isExt) {
|
||||
hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
" %llu %s\n", channel->channel_id, event->eventID, event->description.c_str());
|
||||
" %llu %s\n", channel->getChannelID(), event->eventID, event->description.c_str());
|
||||
}
|
||||
else { // ext output
|
||||
hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
" %ld %u %llu %s\n", channel->channel_id, event->startTime, event->duration, event->eventID, event->description.c_str());
|
||||
" %ld %u %llu %s\n", channel->getChannelID(), event->startTime, event->duration, event->eventID, event->description.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1765,14 +1765,14 @@ void CControlAPI::SendChannelList(CyhookHandler *hh, bool currentTP)
|
||||
CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin();
|
||||
for (; !(cit.EndOfChannels()); cit++) {
|
||||
CZapitChannel * channel = *cit;
|
||||
if(!currentTP || (channel->channel_id >>16) == current_channel){
|
||||
if(!currentTP || (channel->getChannelID() >>16) == current_channel){
|
||||
|
||||
size_t pos = std::find(v.begin(), v.end(), channel->channel_id) - v.begin();
|
||||
size_t pos = std::find(v.begin(), v.end(), channel->getChannelID()) - v.begin();
|
||||
if( pos < v.size() )
|
||||
continue;
|
||||
v.push_back(channel->channel_id);
|
||||
v.push_back(channel->getChannelID());
|
||||
|
||||
hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", channel->channel_id, channel->getName().c_str());
|
||||
hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", channel->getChannelID(), channel->getName().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user