Just for feedback purposes, I've tested with EIT EPG and rating by age is not working.
I cloned the git enigma2 repository and the source code from file lib/python/Components/ParentalControl.py:
def isServicePlayable(self, ref, callback, session=None):
self.session = session
if not config.ParentalControl.servicepinactive.value:
return True
#Check if configuration has already been read or if the significant values have changed.
#If true: read the configuration
if self.storeServicePin != config.ParentalControl.storeservicepin.value:
self.getConfigValues()
service = ref.toCompareString()
info = eServiceCenter.getInstance().info(ref)
age = 0
if service.startswith("1:") and service.rsplit(":", 1)[1].startswith("/"):
refstr = info and info.getInfoString(ref, iServiceInformation.sServiceref)
service = refstr and eServiceReference(refstr).toCompareString()
elif int(config.ParentalControl.age.value):
event = info and info.getEvent(ref)
rating = event and event.getParentalData()
age = rating and rating.getRating()
age = age and age <= 15 and age + 3 or 0
if (age and age >= int(config.ParentalControl.age.value)) or service and self.blacklist.has_key(service):
#Check if the session pin is cached
if self.sessionPinCached:
return True
self.callback = callback
title = 'FROM BOUQUET "userbouquet.' in service and _("this bouquet is protected by a parental control pin") or _("this service is protected by a parental control pin")
if session:
Notifications.RemovePopup("Parental control")
if self.PinDlg:
self.PinDlg.close()
self.PinDlg = session.openWithCallback(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control"), simple=False)
else:
Notifications.AddNotificationParentalControl(boundFunction(self.servicePinEntered, ref), PinInput, triesEntry=config.ParentalControl.retries.servicepin, pinList=self.getPinList(), service=ServiceReference(ref).getServiceName(), title=title, windowTitle=_("Parental control"))
return False
else:
return True
and the function getParentalData from file lib/service/event.cpp:
PyObject *eServiceEvent::getParentalData() const
{
ePyObject ret = PyList_New(m_ratings.size());
int cnt = 0;
for (std::list<eParentalData>::const_iterator it(m_ratings.begin()); it != m_ratings.end(); ++it)
{
ePyObject tuple = PyTuple_New(2);
PyTuple_SET_ITEM(tuple, 0, PyString_FromString(it->getCountryCode().c_str()));
PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(it->getRating()));
PyList_SET_ITEM(ret, cnt++, tuple);
}
return ret;
}
From that I assume that XML age rating should be something like:
<rating system="BR">
<value>14</value>
</rating>
But I'm not a programmer so I don't know if that's correct.
Edited by nether, 15 July 2016 - 15:45.