Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Enhanced "Subtitle then Description" duplicate checking.
Some EIT providers reportedly put the subtitle in the description
field in some situations.  This change extends the "Subtitle then
Description" logic to account for it.  Based on a patch from
lomion0815.

Fixes #9985.
  • Loading branch information
gigem committed Aug 16, 2011
1 parent 546e752 commit a42bfc6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
14 changes: 10 additions & 4 deletions mythtv/libs/libmyth/programinfo.cpp
Expand Up @@ -1893,10 +1893,16 @@ bool ProgramInfo::IsSameProgram(const ProgramInfo& other) const
return false;

if ((dupmethod & kDupCheckSubThenDesc) &&
((subtitle.isEmpty() && other.subtitle.isEmpty() &&
description.toLower() != other.description.toLower()) ||
(subtitle.toLower() != other.subtitle.toLower()) ||
(description.isEmpty() && subtitle.isEmpty())))
((subtitle.isEmpty() &&
((!other.subtitle.isEmpty() &&
description.toLower() != other.subtitle.toLower()) ||
(other.subtitle.isEmpty() &&
description.toLower() != other.description.toLower()))) ||
(!subtitle.isEmpty() &&
((other.subtitle.isEmpty() &&
subtitle.toLower() != other.description.toLower()) ||
(!other.subtitle.isEmpty() &&
subtitle.toLower() != other.subtitle.toLower())))))
return false;

return true;
Expand Down
26 changes: 18 additions & 8 deletions mythtv/programs/mythbackend/scheduler.cpp
Expand Up @@ -3684,10 +3684,15 @@ void Scheduler::AddNewRecords(void)
" (((RECTABLE.dupmethod & 0x04) = 0) OR (program.description <> '' "
" AND program.description = oldrecorded.description)) "
" AND "
" (((RECTABLE.dupmethod & 0x08) = 0) OR (program.subtitle <> '' "
" AND program.subtitle = oldrecorded.subtitle) OR (program.subtitle = '' "
" AND oldrecorded.subtitle = '' AND program.description <> '' "
" AND program.description = oldrecorded.description)) "
" (((RECTABLE.dupmethod & 0x08) = 0) OR "
" (program.subtitle <> '' AND "
" (program.subtitle = oldrecorded.subtitle OR "
" (oldrecorded.subtitle = '' AND "
" program.subtitle = oldrecorded.description))) OR "
" (program.subtitle = '' AND program.description <> '' AND "
" (program.description = oldrecorded.subtitle OR "
" (oldrecorded.subtitle = '' AND "
" program.description = oldrecorded.description)))) "
" ) "
" ) "
" ) "
Expand Down Expand Up @@ -3716,10 +3721,15 @@ void Scheduler::AddNewRecords(void)
" (((RECTABLE.dupmethod & 0x04) = 0) OR (program.description <> '' "
" AND program.description = recorded.description)) "
" AND "
" (((RECTABLE.dupmethod & 0x08) = 0) OR (program.subtitle <> '' "
" AND program.subtitle = recorded.subtitle) OR (program.subtitle = '' "
" AND recorded.subtitle = '' AND program.description <> '' "
" AND program.description = recorded.description)) "
" (((RECTABLE.dupmethod & 0x08) = 0) OR "
" (program.subtitle <> '' AND "
" (program.subtitle = recorded.subtitle OR "
" (recorded.subtitle = '' AND "
" program.subtitle = recorded.description))) OR "
" (program.subtitle = '' AND program.description <> '' AND "
" (program.description = recorded.subtitle OR "
" (recorded.subtitle = '' AND "
" program.description = recorded.description)))) "
" ) "
" ) "
" ) "
Expand Down

0 comments on commit a42bfc6

Please sign in to comment.