* Fixed chk_idxfile() testing for non-applicable method parameters.
authorUrban Wallasch <urban.wallasch@freenet.de>
Thu, 20 May 2021 13:19:20 +0000 (15:19 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Thu, 20 May 2021 13:19:20 +0000 (15:19 +0200)
ffpreview.py

index 4b91a23593c9583f65ce1208b6e1cac0aacf8808..7953157d1108f5ca491082a88792ef2ee68ab473 100755 (executable)
@@ -1290,14 +1290,18 @@ def chk_idxfile(thinfo, thdir):
                     return False
                 if idx['method'] != thinfo['method']:
                     return False
-                if idx['frame_skip'] != thinfo['frame_skip']:
-                    return False
-                if idx['time_skip'] != thinfo['time_skip']:
-                    return False
-                if idx['scene_thresh'] != thinfo['scene_thresh']:
-                    return False
-                if idx['customvf'] != thinfo['customvf']:
-                    return False
+                if idx['method'] == 'skip':
+                    if not 'frame_skip' in idx or idx['frame_skip'] != thinfo['frame_skip']:
+                        return False
+                elif idx['method'] == 'time':
+                    if not 'time_skip' in idx or idx['time_skip'] != thinfo['time_skip']:
+                        return False
+                elif idx['method'] == 'scene':
+                    if not 'scene_thresh' in idx or idx['scene_thresh'] != thinfo['scene_thresh']:
+                        return False
+                elif idx['method'] == 'customvf':
+                    if not 'customvf' in idx or idx['customvf'] != thinfo['customvf']:
+                        return False
             return idx
     except Exception as e:
         eprint(1, idxpath, str(e))