CNeutrinoEventList::findEvents - speedup search in all channelList

This commit is contained in:
Jacek Jendrzej
2013-05-15 14:39:09 +02:00
parent ee4a4cbea1
commit 63bb0996da
2 changed files with 20 additions and 13 deletions

View File

@@ -2253,7 +2253,7 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve
for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e)
{ {
if ((*e)->get_channel_id() == serviceUniqueKey64) { if ((*e)->get_channel_id() == serviceUniqueKey64 || (serviceUniqueKey64 == 1)) {
serviceIDfound = 1; serviceIDfound = 1;
bool copy = true; bool copy = true;
@@ -2289,7 +2289,10 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve
aEvent.text = (*e)->getExtendedText().substr(0, 120); aEvent.text = (*e)->getExtendedText().substr(0, 120);
else else
aEvent.text = (*e)->getText(); aEvent.text = (*e)->getText();
aEvent.channelID = serviceUniqueKey; if(serviceUniqueKey64 == 1)//hack for all channel search
aEvent.channelID = (*e)->get_channel_id();
else
aEvent.channelID = serviceUniqueKey;
eList.push_back(aEvent); eList.push_back(aEvent);
} }
} // if = serviceID } // if = serviceID

View File

@@ -1056,25 +1056,29 @@ bool CNeutrinoEventList::findEvents(void)
} }
else if(m_search_list == SEARCH_LIST_ALL) else if(m_search_list == SEARCH_LIST_ALL)
{ {
CHintBox box(LOCALE_TIMING_EPG,g_Locale->getText(LOCALE_EVENTFINDER_SEARCHING)); CHintBox box(LOCALE_TIMING_EPG,g_Locale->getText(LOCALE_EVENTFINDER_SEARCHING));
box.paint(); box.paint();
int bouquet_nr = bouquetList->Bouquets.size();
std::vector<t_channel_id> v; std::vector<t_channel_id> v;
for(int bouquet = 0; bouquet < bouquet_nr; bouquet++) int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio
{
int channel_nr = bouquetList->Bouquets[bouquet]->channelList->getSize();
for(int channel = 0; channel < channel_nr; channel++) for(int channel = 0; channel < channel_nr; channel++)
{ {
channel_id = bouquetList->Bouquets[bouquet]->channelList->getChannelFromIndex(channel)->channel_id; channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id;
v.push_back(channel_id); v.push_back(channel_id);
} }
}
sort(v.begin(), v.end()); std::map<t_channel_id, t_channel_id > ch_id_map;
std::vector<t_channel_id>::iterator last_it = unique(v.begin(), v.end()); std::vector<t_channel_id>::iterator it;
std::vector<t_channel_id>::iterator it; for (it = v.begin(); it != v.end(); ++it)
for (it = v.begin(); it != last_it; ++it)
{ {
CEitManager::getInstance()->getEventsServiceKey(*it,evtlist, m_search_epg_item,m_search_keyword); ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it;
}
CEitManager::getInstance()->getEventsServiceKey(1/*hack*/,evtlist, m_search_epg_item,m_search_keyword);
CChannelEventList::iterator e;
for ( e=evtlist.begin(); e!=evtlist.end(); ++e )
{
if(e->channelID)
e->channelID = ch_id_map[e->channelID];//map channelID48 to channelID64
} }
box.hide(); box.hide();
} }