Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Duplicate detection doesn't honor disabled timers
  • Loading branch information
Glenn-1990 authored and perexg committed Nov 24, 2016
1 parent fb5ed85 commit 9c2cfc6
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions src/dvr/dvr_db.c
Expand Up @@ -1294,14 +1294,22 @@ static dvr_entry_t *_dvr_duplicate_event(dvr_entry_t *de)
if (de == de2)
continue;

// check for valid states
if (de2->de_sched_state == DVR_NOSTATE ||
de2->de_sched_state == DVR_MISSED_TIME)
continue;

// only earlier recordings qualify as master
if (de2->de_start > de->de_start)
continue;

// only enabled upcoming recordings
if (de2->de_sched_state == DVR_SCHEDULED && !de2->de_enabled)
continue;

// only successful earlier recordings qualify as master
if (de2->de_sched_state == DVR_MISSED_TIME ||
(de2->de_sched_state == DVR_COMPLETED &&
de2->de_last_error != SM_CODE_OK))
if ((de2->de_sched_state == DVR_COMPLETED || de2->de_sched_state == DVR_RECORDING) &&
de2->de_last_error != SM_CODE_OK)
continue;

// if titles are not defined or do not match, don't dedup
Expand All @@ -1318,14 +1326,22 @@ static dvr_entry_t *_dvr_duplicate_event(dvr_entry_t *de)
if (de == de2)
continue;

// check for valid states
if (de2->de_sched_state == DVR_NOSTATE ||
de2->de_sched_state == DVR_MISSED_TIME)
continue;

// only earlier recordings qualify as master
if (de2->de_start > de->de_start)
continue;

// only enabled upcoming recordings
if (de2->de_sched_state == DVR_SCHEDULED && !de2->de_enabled)
continue;

// only successful earlier recordings qualify as master
if (de2->de_sched_state == DVR_MISSED_TIME ||
(de2->de_sched_state == DVR_COMPLETED &&
de2->de_last_error != SM_CODE_OK))
if ((de2->de_sched_state == DVR_COMPLETED || de2->de_sched_state == DVR_RECORDING) &&
de2->de_last_error != SM_CODE_OK)
continue;

// if titles are not defined or do not match, don't dedup
Expand Down

0 comments on commit 9c2cfc6

Please sign in to comment.