mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
CEitManager::getEventsServiceKey - simplification - THX Gaucho316
This commit is contained in:
@@ -2257,27 +2257,23 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve
|
||||
|
||||
bool copy = true;
|
||||
if(search){
|
||||
if((search == 1) || (search == 5)) {//SEARCH_EPG_TITLE == 1 SEARCH_EPG_ALL == 5 defined in eventlist.h
|
||||
if ((search == 1 /*EventList::SEARCH_EPG_TITLE*/) || (search == 5 /*EventList::SEARCH_EPG_ALL*/))
|
||||
{
|
||||
std::string eName = (*e)->getName();
|
||||
std::transform(eName.begin(), eName.end(), eName.begin(), tolower);
|
||||
if(eName.find(search_text) == std::string::npos)
|
||||
copy = false;
|
||||
copy = (eName.find(search_text) != std::string::npos);
|
||||
}
|
||||
if((search == 2) || (!copy && search == 5)) {//SEARCH_EPG_INFO1 == 2
|
||||
if ((search == 2 /*EventList::SEARCH_EPG_INFO1*/) || (!copy && (search == 5 /*EventList::SEARCH_EPG_ALL*/)))
|
||||
{
|
||||
std::string eText = (*e)->getText();
|
||||
std::transform(eText.begin(), eText.end(), eText.begin(), tolower);
|
||||
if(eText.find(search_text) == std::string::npos)
|
||||
copy = false;
|
||||
else if(search == 5)
|
||||
copy = true;
|
||||
copy = (eText.find(search_text) != std::string::npos);
|
||||
}
|
||||
if((search == 3) || (!copy && search == 5)) {//SEARCH_EPG_INFO2 == 3
|
||||
if ((search == 3 /*EventList::SEARCH_EPG_INFO2*/) || (!copy && (search == 5 /*EventList::SEARCH_EPG_ALL*/)))
|
||||
{
|
||||
std::string eExtendedText = (*e)->getExtendedText();
|
||||
std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower);
|
||||
if(eExtendedText.find(search_text) == std::string::npos)
|
||||
copy = false;
|
||||
else if(search == 5)
|
||||
copy = true;
|
||||
copy = (eExtendedText.find(search_text) != std::string::npos);
|
||||
}
|
||||
}
|
||||
if(copy) {
|
||||
|
Reference in New Issue
Block a user