add the name of missing skin element to debug output
[enigma2.git] / lib / dvb / epgcache.cpp
index 81b96a82150c8178f917c59d3bc2a6efa6c0a981..8cdfa0c97c1d98d51638c692d8bafb9aed895324 100644 (file)
@@ -1508,33 +1508,30 @@ RESULT eEPGCache::lookupEventId(const eServiceReference &service, int event_id,
 RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin, int minutes)
 {
        const eServiceReferenceDVB &ref = (const eServiceReferenceDVB&)handleGroup(service);
+       if (begin == -1)
+               begin = eDVBLocalTimeHandler::getInstance()->nowTime();
        Lock();
        eventCache::iterator It = eventDB.find(ref);
        if ( It != eventDB.end() && It->second.second.size() )
        {
-               if ( begin != -1 )
+               m_timemap_cursor = It->second.second.lower_bound(begin);
+               if ( m_timemap_cursor != It->second.second.end() )
                {
-                       m_timemap_cursor = It->second.second.lower_bound(begin);
-                       if ( m_timemap_cursor != It->second.second.end() )
+                       if ( m_timemap_cursor->first != begin )
                        {
-                               if ( m_timemap_cursor->first != begin )
+                               timeMap::iterator x = m_timemap_cursor;
+                               --x;
+                               if ( x != It->second.second.end() )
                                {
-                                       timeMap::iterator x = m_timemap_cursor;
-                                       --x;
-                                       if ( x != It->second.second.end() )
-                                       {
-                                               time_t start_time = x->first;
-                                               if ( begin > start_time && begin < (start_time+x->second->getDuration()))
-                                                       m_timemap_cursor = x;
-                                       }
+                                       time_t start_time = x->first;
+                                       if ( begin > start_time && begin < (start_time+x->second->getDuration()))
+                                               m_timemap_cursor = x;
                                }
                        }
                }
-               else
-                       m_timemap_cursor = It->second.second.begin();
 
-               if (minutes != -1 && m_timemap_cursor != It->second.second.end())
-                       m_timemap_end = It->second.second.upper_bound(m_timemap_cursor->first+minutes*60);
+               if (minutes != -1)
+                       m_timemap_end = It->second.second.upper_bound(begin+minutes*60);
                else
                        m_timemap_end = It->second.second.end();
 
@@ -1799,6 +1796,10 @@ PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc)
                                                break;
                                }
                        }
+
+                       if (minutes && stime == -1)
+                               stime = eDVBLocalTimeHandler::getInstance()->nowTime();
+
                        eServiceReference ref(handleGroup(eServiceReference(PyString_AS_STRING(service))));
                        if (ref.type != eServiceReference::idDVB)
                        {
@@ -1873,6 +1874,8 @@ PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc)
                                                }
                                        }
                                }
+                               else
+                                       handleEvent(0, dest_list, argstring, argcount, service, nowTime, service_name, convertFunc, convertFuncArgs);
                                Unlock();
                        }
                        else
@@ -2253,6 +2256,11 @@ PyObject *eEPGCache::search(ePyObject arg)
                                                {
                                                        if (lookupEventId(ref, evid, ev))
                                                                eDebug("event not found !!!!!!!!!!!");
+                                                       else
+                                                       {
+                                                               const eServiceReferenceDVB &dref = (const eServiceReferenceDVB&)ref;
+                                                               ptr.parseFrom(ev, (dref.getTransportStreamID().get()<<16)|dref.getOriginalNetworkID().get());
+                                                       }
                                                }
                                        // create service name
                                                if (!service_name)