From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Tue, 9 Oct 2018 00:35:49 +0000 (+0100) Subject: Need to delete files on complex scheduling when replacing timer after crash. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b99571d1dc4ef61acf93a598fc434eba465c0d0;p=thirdparty%2Ftvheadend.git Need to delete files on complex scheduling when replacing timer after crash. Scenario: Complex scheduling enabled. Recording ok, then crash and restart. In this case, the recording is not currently running, so we can find a better recording. If there is a better recording later in the week, that show will get preference (since complex recording states we don't want a partial recording so prefer a later date for a full recording). But, we used to destroy the dvr_entry, but this does not delete its associated files so they would be left on disk as orphans/unreferenced from any dvr/log file. --- diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index c1d3da7cd..e77df547e 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -2032,6 +2032,7 @@ dvr_entry_create_by_autorec(int enabled, epg_broadcast_t *e, dvr_autorec_entry_t gmtime2local(replace->de_bcast->start, t1buf, sizeof t1buf), e->channel ? channel_get_name(e->channel, channel_blank_name) : channel_blank_name, gmtime2local(e->start, t2buf, sizeof t2buf)); + dvr_entry_delete(replace); dvr_entry_destroy(replace, 1); }