The problem was that we were using the EIT eventid as the program id
which was breaking the duplicate detection code. (event id's are unique
for events across the channel, so the same program will have different
id's if it's repeated)

Hopefully this patch should get things going.

On Tue, 2005-03-01 at 09:06 +0000, John Pullan wrote:
> The internal dvb eit is not working currently. I'm looking into it at
> the moment. My original question was due to me not getting the original
> tv_grab_dvb code working, so I was trying to work out why.
> 
> Now I've got that working I'm moving on to fixing the internal code.
> 
<snip>
Index: siparser.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/siparser.cpp,v
retrieving revision 1.7
diff -u -r1.7 siparser.cpp
--- siparser.cpp	23 Feb 2005 05:04:36 -0000	1.7
+++ siparser.cpp	1 Mar 2005 21:03:47 -0000
@@ -2806,6 +2806,7 @@
 
 void SIParser::EITFixUp(Event& event)
 {
+    event.AirDate = event.StartTime.date();
     if (event.Description == "" && event.Event_Subtitle != "") 
     {
          event.Description = event.Event_Subtitle;        
@@ -2826,6 +2827,10 @@
                    break; 
     }
 
+    event.Event_Name.stripWhiteSpace();
+    event.Event_Subtitle.stripWhiteSpace();
+    event.Description.stripWhiteSpace();
+
 }
 
 void SIParser::EITFixUpStyle1(Event& event)
Index: siscan.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/siscan.cpp,v
retrieving revision 1.8
diff -u -r1.8 siscan.cpp
--- siscan.cpp	23 Feb 2005 19:39:19 -0000	1.8
+++ siscan.cpp	1 Mar 2005 21:03:48 -0000
@@ -986,11 +986,11 @@
         {
 
             query.prepare("select * from  program where chanid=:CHANID and "
-                      "starttime=:STARTTIME and programid=:PROGRAMID;");
+                      "starttime=:STARTTIME and title=:TITLE;");
             query.bindValue(":CHANID",ChanID);
             query.bindValue(":STARTTIME",(*e).StartTime.toString(QString("yyyy-MM-dd hh:mm:00")));
             query.bindValue(":ENDTIME",(*e).EndTime.toString(QString("yyyy-MM-dd hh:mm:00")));
-            query.bindValue(":PROGRAMID",(*e).EventID);
+            query.bindValue(":TITLE",(*e).Event_Name.utf8());
 
             if(!query.exec())
                 MythContext::DBError("Checking Event", query);
@@ -1003,9 +1003,9 @@
                  counter++;
 
                  query.prepare("INSERT INTO program (chanid,starttime,endtime,"
-                          "title,description,subtitle,category,programid,"
-                          "stereo,closecaptioned,hdtv)"
-                          "VALUES (:CHANID,:STARTTIME,:ENDTIME,:TITLE,:DESCRIPTION,:SUBTITLE,:CATEGORY,:PROGRAMID,:STEREO,:CLOSECAPTIONED,:HDTV);");
+                          "title,description,subtitle,category,"
+                          "stereo,closecaptioned,hdtv,airdate)"
+                          "VALUES (:CHANID,:STARTTIME,:ENDTIME,:TITLE,:DESCRIPTION,:SUBTITLE,:CATEGORY,:STEREO,:CLOSECAPTIONED,:HDTV,:AIRDATE);");
                 query.bindValue(":CHANID",ChanID);
                 query.bindValue(":STARTTIME",(*e).StartTime.toString(QString("yyyy-MM-dd hh:mm:00")));
                 query.bindValue(":ENDTIME",(*e).EndTime.toString(QString("yyyy-MM-dd hh:mm:00")));
@@ -1013,10 +1013,10 @@
                 query.bindValue(":DESCRIPTION",(*e).Description.utf8());
                 query.bindValue(":SUBTITLE",(*e).Event_Subtitle.utf8());
                 query.bindValue(":CATEGORY",(*e).ContentDescription.utf8());
-                query.bindValue(":PROGRAMID",(*e).EventID);
                 query.bindValue(":STEREO",(*e).Stereo);
                 query.bindValue(":CLOSECAPTIONED",(*e).SubTitled);
                 query.bindValue(":HDTV",(*e).HDTV);
+                query.bindValue(":AIRDATE",(*e).AirDate.toString(QString("yyyy")));
 
                 if(!query.exec())
                     MythContext::DBError("Adding Event", query);
Index: sitypes.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/sitypes.h,v
retrieving revision 1.3
diff -u -r1.3 sitypes.h
--- sitypes.h	31 Jan 2005 05:49:56 -0000	1.3
+++ sitypes.h	1 Mar 2005 21:03:49 -0000
@@ -313,6 +313,7 @@
     uint16_t SourcePID;    /* Used in ATSC for Checking for ETT PID being filtered */
     QDateTime StartTime;
     QDateTime EndTime;
+    QDate AirDate;
     uint16_t TransportID;
     uint16_t NetworkID;
     QString LanguageCode;
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to