From c733639969a50c7db826593d2fc7f8e7899418e2 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Tue, 7 Jun 2022 20:40:23 +0300 Subject: tools/process-motion-timecodes.py: don't proceed if no valid timecodes left after filtering --- tools/process-motion-timecodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/process-motion-timecodes.py b/tools/process-motion-timecodes.py index 70c990d..ba4ee26 100755 --- a/tools/process-motion-timecodes.py +++ b/tools/process-motion-timecodes.py @@ -48,6 +48,8 @@ if __name__ == '__main__': # sort out invalid fragments (dvr-scan returns them sometimes, idk why...) timecodes = list(filter(lambda f: f[0] < f[1], timecodes)) + if not timecodes: + raise ValueError('no valid timecodes') file_dt = filename_to_datetime(arg.source_filename) -- cgit v1.2.3