Ticket #2207: mythfilldb-externally_handled.diff

File mythfilldb-externally_handled.diff, 2.1 KB (added by otto at kolsi dot fi, 18 years ago)

Updated patch from Michael T. Dean. Works now for mixed sources (eitonly and non-eitonly) and also for no_grabber sources.

  • programs/mythfilldatabase/filldata.cpp

     
    28232823    MSqlQuery query(MSqlQuery::InitCon());
    28242824    QDateTime GuideDataBefore, GuideDataAfter;
    28252825    int failures = 0;
     2826    int externally_handled = 0;
     2827    int total_sources = sourcelist.size();
    28262828
    28272829    query.exec(QString("SELECT MAX(endtime) FROM program WHERE manualid=0;"));
    28282830    if (query.isActive() && query.size() > 0)
     
    31013103        {
    31023104            VERBOSE(VB_IMPORTANT, "Source configured to use only the "
    31033105                    "broadcasted guide data. Skipping.");
     3106            externally_handled++;
     3107            query.exec(QString("UPDATE settings SET data ='%1' "
     3108                               "WHERE value='mythfilldatabaseLastRunStart' OR "
     3109                               "value = 'mythfilldatabaseLastRunEnd'")
     3110                       .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm")));
    31043111        }
    31053112        else if (xmltv_grabber == "/bin/true" ||
    31063113                 xmltv_grabber == "none" ||
     
    31083115        {
    31093116            VERBOSE(VB_IMPORTANT,
    31103117                    "Source configured with no grabber. Nothing to do.");
     3118            externally_handled++;
     3119            query.exec(QString("UPDATE settings SET data ='%1' "
     3120                               "WHERE value='mythfilldatabaseLastRunStart' OR "
     3121                               "value = 'mythfilldatabaseLastRunEnd'")
     3122                       .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm")));
    31113123        }
    31123124        else
    31133125        {
     
    31373149
    31383150    if (failures == 0)
    31393151    {
    3140         if (GuideDataAfter == GuideDataBefore)
     3152        if ((GuideDataAfter == GuideDataBefore) &&
     3153            (total_sources != externally_handled))
    31413154            status = "mythfilldatabase ran, but did not insert "
    31423155                     "any new data into the Guide.  This can indicate a "
    31433156                     "potential grabber failure.";