Ticket #9985: Enhanced_DupCheck_2.patch

File Enhanced_DupCheck_2.patch, 3.3 KB (added by lomion0815@…, 13 years ago)

Clean-up of the code

  • mythtv/libs/libmyth/programinfo.cpp

    diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp
    index 2a253d2..471d53b 100644
    a b bool ProgramInfo::IsSameProgram(const ProgramInfo& other) const 
    17951795
    17961796    if (!programid.isEmpty() && !other.programid.isEmpty())
    17971797        return programid == other.programid;
     1798
     1799    if ((dupmethod &  kDupCheckSubThenDesc) &&
     1800        ((!subtitle.isEmpty()&&
     1801          (subtitle.toLower() == other.subtitle.toLower() ||
     1802          subtitle.toLower() == other.description.toLower())) ||
     1803         (!description.isEmpty()&&
     1804          (description.toLower() == other.subtitle.toLower() ||
     1805          description.toLower() == other.description.toLower()))
     1806       ))
     1807        return true;
    17981808
    17991809    if ((dupmethod & kDupCheckSub) &&
    18001810        ((subtitle.isEmpty()) ||
    bool ProgramInfo::IsSameProgram(const ProgramInfo& other) const 
    18061816         (description.toLower() != other.description.toLower())))
    18071817        return false;
    18081818
    1809     if ((dupmethod & kDupCheckSubThenDesc) &&
    1810         ((subtitle.isEmpty() && other.subtitle.isEmpty() &&
    1811           description.toLower() != other.description.toLower()) ||
    1812          (subtitle.toLower() != other.subtitle.toLower()) ||
    1813          (description.isEmpty() && subtitle.isEmpty())))
    1814         return false;
    1815 
    18161819    return true;
    18171820}
    18181821
  • mythtv/programs/mythbackend/scheduler.cpp

    diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
    index c9837fe..2e86261 100644
    a b void Scheduler::AddNewRecords(void) 
    33293329"          AND program.description = oldrecorded.description)) "
    33303330"       AND "
    33313331"       (((RECTABLE.dupmethod & 0x08) = 0) OR (program.subtitle <> '' "
    3332 "          AND program.subtitle = oldrecorded.subtitle) OR (program.subtitle = ''  "
    3333 "          AND oldrecorded.subtitle = '' AND program.description <> '' "
    3334 "          AND program.description = oldrecorded.description)) "
     3332"          AND program.subtitle = oldrecorded.subtitle) "
     3333"          OR (program.subtitle <> '' "
     3334"          AND program.subtitle = oldrecorded.description )"
     3335"          OR (program.description <> '' "
     3336"          AND program.description = oldrecorded.description) "
     3337"          OR (program.description <> '' "
     3338"          AND program.description = oldrecorded.subtitle)) "
    33353339"      ) "
    33363340"     ) "
    33373341"  ) "
    void Scheduler::AddNewRecords(void) 
    33613365"          AND program.description = recorded.description)) "
    33623366"       AND "
    33633367"       (((RECTABLE.dupmethod & 0x08) = 0) OR (program.subtitle <> '' "
    3364 "          AND program.subtitle = recorded.subtitle) OR (program.subtitle = ''  "
    3365 "          AND recorded.subtitle = '' AND program.description <> '' "
    3366 "          AND program.description = recorded.description)) "
     3368"          AND program.subtitle = recorded.subtitle) "
     3369"          OR (program.subtitle <> '' "
     3370"          AND program.subtitle = recorded.description )"
     3371"          OR (program.description <> '' "
     3372"          AND program.description = recorded.description) "
     3373"          OR (program.description <> '' "
     3374"          AND program.description = recorded.subtitle)) "
    33673375"      ) "
    33683376"     ) "
    33693377"  ) "