From: Johan Rehnberg Date: Sun, 13 Oct 2013 18:15:15 +0000 (+0200) Subject: programs with non zero and equal episode numbers are considered duplicates X-Git-Tag: v4.1~2002^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb26496186f9dd0318818fe28cce2a04f9b6b23c;p=thirdparty%2Ftvheadend.git programs with non zero and equal episode numbers are considered duplicates --- diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index fd54d3a04..2129f2323 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -427,11 +427,23 @@ dvr_entry_create_by_event(const char *config_name, creator, dae, pri); } +/** + * Considered a duplicate if it has episode numbers and it is equal to an existing recording + */ static int _dvr_duplicate_event ( epg_broadcast_t *e ) { dvr_entry_t *de; + epg_episode_num_t empty_epnum; + + memset(&empty_epnum, 0, sizeof(empty_epnum)); + if (epg_episode_number_cmp(&empty_epnum, &e->episode->epnum) == 0) + return 0; + LIST_FOREACH(de, &dvrentries, de_global_link) { - if (de->de_bcast && (de->de_bcast->episode == e->episode)) return 1; + if (de->de_bcast && epg_episode_number_cmp(&de->de_bcast->episode->epnum, &e->episode->epnum) == 0) + { + return 1; + } } return 0; }