@@ -589,24 +589,73 @@ inline bool compareServices(const eServiceReference &src, const eServiceReferenc
589589
590590bool eListboxPythonServiceContent::checkServiceIsRecorded (eServiceReference ref, pNavigation::RecordType type)
591591{
592- std::map<ePtr<iRecordableService>, eServiceReference, std::less<iRecordableService *>> recordedServices;
593- recordedServices = eNavigation::getInstance ()->getRecordingsServices (type);
594- for (std::map<ePtr<iRecordableService>, eServiceReference>::iterator it = recordedServices.begin (); it != recordedServices.end (); ++it)
592+
593+ const bool isGroup = ref.flags & eServiceReference::isGroup;
594+
595+ eBouquet *bouquet = nullptr ;
596+ if (isGroup)
595597 {
596- if (ref.flags & eServiceReference::isGroup)
598+ static ePtr<eDVBResourceManager> res = nullptr ;
599+ if (!res)
600+ eDVBResourceManager::getInstance (res);
601+ if (res)
597602 {
598603 ePtr<iDVBChannelList> db;
599- ePtr<eDVBResourceManager> res;
600- eDVBResourceManager::getInstance (res);
601604 res->getChannelList (db);
602- eBouquet *bouquet = 0 ;
603- db->getBouquet (ref, bouquet);
604- for (std::list<eServiceReference>::iterator i (bouquet->m_services .begin ()); i != bouquet->m_services .end (); ++i)
605- if (*i == it->second || compareServices (*i, it->second ))
605+ if (db)
606+ db->getBouquet (ref, bouquet);
607+ }
608+ if (!bouquet)
609+ return false ;
610+ }
611+
612+ std::vector<eServiceReference> recordedServices;
613+ eNavigation::getInstance ()->getRecordingsServicesOnly (recordedServices, type);
614+
615+ if (!recordedServices.empty ())
616+ {
617+ if (isGroup)
618+ {
619+ for (const auto &service : bouquet->m_services )
620+ {
621+ for (const auto &recordedService : recordedServices)
622+ {
623+ if (service == recordedService || compareServices (service, recordedService))
624+ return true ;
625+ }
626+ }
627+ }
628+ else
629+ {
630+ for (const auto &recordedService : recordedServices)
631+ {
632+ if (ref == recordedService || compareServices (ref, recordedService))
633+ return true ;
634+ }
635+ }
636+ }
637+
638+ if (type & pNavigation::isStreaming)
639+ {
640+ const auto &streamServices = eNavigation::getInstance ()->getStreamServiceList ();
641+ if (!streamServices.empty ())
642+ {
643+ const std::string refString = ref.toString ();
644+
645+ if (isGroup)
646+ {
647+ for (const auto &service : bouquet->m_services )
648+ {
649+ if (std::find (streamServices.begin (), streamServices.end (),service.toString ()) != streamServices.end ())
650+ return true ;
651+ }
652+ }
653+ else
654+ {
655+ if (std::find (streamServices.begin (), streamServices.end (),refString) != streamServices.end ())
606656 return true ;
657+ }
607658 }
608- else if (ref == it->second || compareServices (ref, it->second ))
609- return true ;
610659 }
611660 return false ;
612661}
0 commit comments