From c837a17aea485c10b4f8506b74d5f4205d35b9f8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 18 Aug 2020 13:25:18 -0400 Subject: [PATCH] Add a warning about missing EndTime term on UpdateDiskSpace --- web/skins/classic/views/js/filter.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/skins/classic/views/js/filter.js b/web/skins/classic/views/js/filter.js index ad90bd3a5..0787ee577 100644 --- a/web/skins/classic/views/js/filter.js +++ b/web/skins/classic/views/js/filter.js @@ -36,6 +36,17 @@ function validateForm( form ) { if ( ! have_archivestatus_term ) { return confirm('You have enabled deleting events but do not have a term referencing the archived status of the event. This filter may delete events that you want to save! Are you sure?'); } + } else if ( form.elements['filter[UpdateDiskSpace]'].checked ) { + var have_endtime_term = false; + for ( var i = 0; i < rows.length; i++ ) { + if ( form.elements['filter[Query][terms][' + i + '][attr]'].value == 'EndDateTime' ) { + have_endtime_term = true; + } + } + if ( ! have_endtime_term ) { + return confirm('You don\'t have an EndTime term in your filter. This will match recordings that are still in progress and so the UpdateDiskSpace action will be a waste of time and resources. Ideally you should have an EndTime IS NOT NULL term. Do you want to continue?'); + } + } else if ( form.elements['filter[Background]'].checked ) { if ( ! ( form.elements['filter[AutoArchive]'].checked