Thread Terminating with Exception: stoi: no conversion
Macadoshis opened this issue · comments
Hello @AlwinEsch , @phunkyfish,
(sorry for the mentions but you look like the only 2 guys active)
I think there's an issue in the following process :
pvr.stalker/src/GuideManager.cpp
Lines 186 to 191 in ef24347
I get following error when loading my XMLEPG :
AddOnLog: pvr.stalker: GetEPGForChannel: time range: 1662776667 - 1662949467 | 7512 - Trace Urban
AddOnLog: pvr.stalker: GetChannelEvents
Thread Terminating with Exception: stoi: no conversion
Indeed for a programme
as follow :
<?xml version="1.0" encoding="UTF-8"?>
<tv>
<channel id="TraceUrban.fr">
<display-name>Trace Urban</display-name>
</channel>
<programme start="20220910133000 +0000" stop="20220910140000 +0000" channel="TraceUrban.fr">
<title lang="fr-FR" >Hits Non Stop</title>
<desc lang="fr-FR">Sélection des plus grands succès musicaux du moment.</desc>
</programme>
there's actually no default fallback in the instantiation of a programme
from xml for the 2 properties date
and star-rating
that actually most of the XMLTV providers don't offer (!)
pvr.stalker/lib/libstalkerclient/xmltv.c
Line 266 in ef24347
So the std::stoi
method tries to read a null value producing this error.
I've tested with the following fix, by manually adding in epg_xmltv.xml :
<?xml version="1.0" encoding="UTF-8"?>
<tv>
<channel id="TraceUrban.fr">
<display-name>Trace Urban</display-name>
</channel>
<programme start="20220910133000 +0000" stop="20220910140000 +0000" channel="TraceUrban.fr">
<title lang="fr-FR" >Hits Non Stop</title>
<desc lang="fr-FR">Sélection des plus grands succès musicaux du moment.</desc>
<date>20220910</date>
<star-rating>
<value>1</value>
</star-rating>
</programme>
and it worked (stalkerclient managed to create the guide for this program and channel).
TL;DR
So can you please :
-
Either check upon null/empty before read or instantiate by default the
XMLTV::Programme#date
from thestart
(YYYYMMDD). -
Either check upon null/empty before read or instantiate by default the
XMLTV::Programme#starRating
to0
or1
.
Thanks a lot.
I think it might help a lot of people and prevent me from having to fork just for those 2 minor fixes.
As shown in the DTD, star-rating
and date
are no mandatory fields, so the code should work when those 2 fields are missing.
Can you PR the change? I’m happy to review it you do so. On the Nexus branch first please.