Ticket #9931: lookup.diff

File lookup.diff, 2.2 KB (added by Doug Haber <doug@…>, 13 years ago)
  • mythtv/programs/mythmetadatalookup/lookup.cpp

    diff --git a/mythtv/programs/mythmetadatalookup/lookup.cpp b/mythtv/programs/mythmetadatalookup/lookup.cpp
    index b25b91f..0345094 100644
    a b void LookerUpper::customEvent(QEvent *levent) 
    316320
    317321        LOG(VB_GENERAL, LOG_DEBUG, "I found the following data:");
    318322        LOG(VB_GENERAL, LOG_DEBUG,
     323            QString("        Input Type:  %1").arg(lookup->GetData().typeName()));
     324        LOG(VB_GENERAL, LOG_DEBUG,
    319325            QString("        Input Title: %1").arg(pginfo->GetTitle()));
    320326        LOG(VB_GENERAL, LOG_DEBUG,
    321327            QString("        Input Sub:   %1").arg(pginfo->GetSubtitle()));
    322328        LOG(VB_GENERAL, LOG_DEBUG,
     329            QString("        Input Chanid:%1").arg(pginfo->GetChanID()));
     330        LOG(VB_GENERAL, LOG_DEBUG,
     331            QString("        Input Start: %1").arg(pginfo->GetRecordingStartTime().toString()));
     332        LOG(VB_GENERAL, LOG_DEBUG,
     333            QString("        Input End:   %1").arg(pginfo->GetRecordingEndTime().toString()));
     334        LOG(VB_GENERAL, LOG_DEBUG,
    323335            QString("        Title:       %1").arg(lookup->GetTitle()));
    324336        LOG(VB_GENERAL, LOG_DEBUG,
    325337            QString("        Subtitle:    %1").arg(lookup->GetSubtitle()));
    void LookerUpper::customEvent(QEvent *levent) 
    332344        LOG(VB_GENERAL, LOG_DEBUG,
    333345            QString("        User Rating: %1").arg(lookup->GetUserRating()));
    334346
    335         if (!lookup->GetSubtype() == kProbableGenericTelevision)
    336             pginfo->SaveSeasonEpisode(lookup->GetSeason(), lookup->GetEpisode());
    337         pginfo->SaveInetRef(lookup->GetInetref());
     347        // If the start time == the end time then this is actually a recording rule
     348        // and updating it could corrupt data
     349        if (pginfo->GetRecordingStartTime() != pginfo->GetRecordingEndTime()) {
     350            LOG(VB_GENERAL, LOG_DEBUG, QString("Valid ProgramInfo - updating"));
     351            if (!lookup->GetSubtype() == kProbableGenericTelevision)
     352                pginfo->SaveSeasonEpisode(lookup->GetSeason(), lookup->GetEpisode());
     353            pginfo->SaveInetRef(lookup->GetInetref());
     354        }
    338355
    339356        if (m_updaterules)
    340357        {