[mythtv] old_xmltvid ?

Laurent ARNAL laurent at clae.net
Thu May 7 20:42:31 UTC 2009


   Hi,

I was looking into code of mythfilldatabase tonight to understand how 
xmltv graber are working.
I find the following code in channeldata.cpp near line 177. There's 
something about an "old_xmltvid" member in the ChanInfo structure,
and the code seems to be something like an update procedure when you 
rescan for program.
What strange is that I don't see where this old_xmltvid is coming from. 
There is a ChanInfo constructor wich take the old_xmltvid in parameter, 
but I can't see anywhere a call to this constructor.

Do someone know how it may work ?

Thanks,
       Laurent.


=======================

        if (!(*i).old_xmltvid.isEmpty())
        {
            query.prepare(
                "SELECT xmltvid "
                "FROM channel "
                "WHERE xmltvid = :XMLTVID");
            query.bindValue(":XMLTVID", (*i).old_xmltvid);


            if (!query.exec())
            {
                MythDB::DBError("xmltvid conversion 1", query);
            }
            else if (query.next())
            {
                VERBOSE(VB_GENERAL,
                        QString("Converting old xmltvid (%1) to new (%2)")
                        .arg((*i).old_xmltvid).arg((*i).xmltvid));

                query.prepare("UPDATE channel "
                              "SET xmltvid = :NEWXMLTVID"
                              "WHERE xmltvid = :OLDXMLTVID");
                query.bindValue(":NEWXMLTVID", (*i).xmltvid);
                query.bindValue(":OLDXMLTVID", (*i).old_xmltvid);

                if (!query.exec())
                {
                    MythDB::DBError("xmltvid conversion 2", query);
                }
            }
        }



More information about the mythtv-dev mailing list