From bddaec4dbe7e374448793d6d4767876ecdb34602 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 26 May 2022 04:04:13 -0400 Subject: [PATCH] fixed bug where non_drop_frame wasn't getting assigned as a boolean --- fcpx_marker_tool/parsers/fcpxparser.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fcpx_marker_tool/parsers/fcpxparser.py b/fcpx_marker_tool/parsers/fcpxparser.py index cf8ce96..dbe20e6 100644 --- a/fcpx_marker_tool/parsers/fcpxparser.py +++ b/fcpx_marker_tool/parsers/fcpxparser.py @@ -82,6 +82,8 @@ def _filter_media_child_element(self, resource): else: duration = child_element.get('duration') + non_drop_frame = self._parse_non_drop_frame(non_drop_frame) + return start, duration, format, non_drop_frame def _undefined_format_check(self, format_element): @@ -191,7 +193,7 @@ def _get_clip_format_info(self, clip_element, resource_id, timeline_obj=None): if format: frame_rate_tuple, interlaced = self._frame_info_from_format(format) - non_drop_frame = clip_element.get('tcFormat') + non_drop_frame = self._parse_non_drop_frame(clip_element.get('tcFormat')) elif resource_id is not None: frame_rate_tuple, non_drop_frame, interlaced = self._parse_ref_info(resource_id) else: @@ -274,9 +276,9 @@ def _parse_ref_info(self, resource_id): return frame_rate, non_drop_frame, interlaced - def _parse_non_drop_frame(self, timecode_format): + def _parse_non_drop_frame(self, timecode_format_string): # easiest to make anything that isn't 'DF' True, since 'NDF' is most common and this will catch if timecode_format is None - if timecode_format == 'DF': + if timecode_format_string == 'DF': return False else: return True @@ -294,6 +296,7 @@ def _get_timeline_info(self, timeline_element): name = timeline_element.get('name') sequence_element = timeline_element.find('./sequence') start, duration, format, non_drop_frame = self._get_attributes(sequence_element, 'tcStart','duration', 'format', 'tcFormat') + non_drop_frame = self._parse_non_drop_frame(non_drop_frame) frame_rate_tuple, interlaced = self._frame_info_from_format(format) timecode_info = self._create_timecode_info(frame_rate_tuple, start, duration, offset=0, non_drop_frame=non_drop_frame)