diff options
-rw-r--r-- | dist/epgdata2xmltv/epgdata2xmltv.xsl | 7 | ||||
-rw-r--r-- | event.cpp | 2 | ||||
-rw-r--r-- | parse.cpp | 21 | ||||
-rw-r--r-- | parse.h | 3 | ||||
-rw-r--r-- | source.cpp | 3 | ||||
-rw-r--r-- | xmltv2vdr.cpp | 4 |
6 files changed, 30 insertions, 10 deletions
diff --git a/dist/epgdata2xmltv/epgdata2xmltv.xsl b/dist/epgdata2xmltv/epgdata2xmltv.xsl index 6b0dfcd..1b0fe9e 100644 --- a/dist/epgdata2xmltv/epgdata2xmltv.xsl +++ b/dist/epgdata2xmltv/epgdata2xmltv.xsl @@ -173,6 +173,10 @@ G <xsl:value-of select="d25"/> </xsl:attribute> <xsl:text>
</xsl:text> +<xsl:if test="string-length($EVENTID)"> +<xsl:comment> pid = <xsl:value-of select="$EVENTID"/><xsl:text> </xsl:text></xsl:comment><xsl:text>
</xsl:text> +</xsl:if> + <title lang="de"><xsl:value-of select="d19"/></title><xsl:text>
</xsl:text> <xsl:if test="string-length(d20)"> <sub-title lang="de"><xsl:value-of select="d20"/></sub-title><xsl:text>
</xsl:text> @@ -192,9 +196,6 @@ G <xsl:value-of select="d25"/> <xsl:if test="string-length($GENRE)"> <category lang="de"><xsl:value-of select="$GENRE"/></category><xsl:text>
</xsl:text> </xsl:if> -<xsl:if test="string-length($EVENTID)"> -<category lang="de"><xsl:value-of select="$EVENTID"/></category><xsl:text>
</xsl:text> -</xsl:if> <xsl:if test="string-length($PICS)"> <xsl:copy-of select="$PICS"/> </xsl:if> @@ -295,6 +295,8 @@ const char *cXMLTVEvent::GetSQL(const char *Source, int SrcIdx, const char *Chan const char *vi=video.toString(); const char *pi=pics.toString(); + if (!eventid) eventid=starttime; // that's very weak! + if (asprintf(&sql,"INSERT OR IGNORE INTO epg (src,channelid,eventid,starttime,duration,"\ "title,origtitle,shorttext,description,country,year,credits,category,"\ "review,rating,starrating,video,audio,season,episode,episodeoverall,pics,srcidx) "\ @@ -288,6 +288,17 @@ bool cParse::FetchEvent(xmlNodePtr enode, bool useeptext) xmlNodePtr node=enode->xmlChildrenNode; while (node) { + if (node->type==XML_COMMENT_NODE) + { + if (const xmlChar *pid=xmlStrstr(node->content,(const xmlChar *) "pid")) + { + char *eq=strchr((char *) pid,'='); + if (eq) + { + xevent.SetEventID(atol(eq+6)); + } + } + } if (node->type==XML_ELEMENT_NODE) { if ((!xmlStrcasecmp(node->name, (const xmlChar *) "title"))) @@ -383,7 +394,7 @@ bool cParse::FetchEvent(xmlNodePtr enode, bool useeptext) { if (isdigit(content[0])) { - xevent.SetEventID(atoi((const char *) content)); + xevent.SetEventID(atol((const char *) content)); } else { @@ -763,6 +774,14 @@ int cParse::Process(cEPGExecutor &myExecutor,char *buffer, int bufsize) node=node->next; continue; } + + if (!xevent.EventID()) + { + if (lerr!=PARSE_NOEVENTID) + isyslogs(source,"event without id, using weak id!"); + lerr=PARSE_NOEVENTID; + } + for (int i=0; i<map->NumChannelIDs(); i++) { const char *sql=xevent.GetSQL(source->Name(),source->Index(),map->ChannelIDs()[i].ToString()); @@ -29,7 +29,8 @@ class cParse PARSE_NOMAPPING, PARSE_NOCHANNELID, PARSE_FETCHERR, - PARSE_SQLERR + PARSE_SQLERR, + PARSE_NOEVENTID }; private: @@ -78,7 +78,7 @@ void cEPGExecutor::Action() } retries++; } - if ((retries==2) || (!ret)) break; + if ((retries==2 || (ret==127)) || (!ret)) break; } if (retries>=2) esyslogs(epgs,"skipping after %i retries",retries); } @@ -101,7 +101,6 @@ void cEPGExecutor::Action() } } } - if (!ret) cSchedules::Cleanup(true); forceimportsrc=-1; forcedownload=false; } diff --git a/xmltv2vdr.cpp b/xmltv2vdr.cpp index 8c7000c..420ad7b 100644 --- a/xmltv2vdr.cpp +++ b/xmltv2vdr.cpp @@ -438,7 +438,6 @@ void cEPGTimer::Action() bool useeptext=((epall & EPLIST_USE_TEXT)==EPLIST_USE_TEXT); int Flags=USE_SEASON; if (useeptext) Flags|=(USE_SHORTTEXT|USE_TITLE); - bool changed=false; for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) { if (Timer->Recording()) continue; // to late ;) @@ -464,7 +463,7 @@ void cEPGTimer::Action() } free((void*)ChannelID); - if (import.PutEvent(source,db,NULL,event,xevent,Flags)) changed=true; + import.PutEvent(source,db,NULL,event,xevent,Flags); delete xevent; } if (db) @@ -473,7 +472,6 @@ void cEPGTimer::Action() sqlite3_close(db); } Timers.DecBeingEdited(); - if (changed) cSchedules::Cleanup(true); } // ------------------------------------------------------------- |