From 56d13f9161c87c22ef076baf76d6609d357caf8d Mon Sep 17 00:00:00 2001 From: McLP2 Date: Fri, 4 Jul 2025 22:06:32 +0200 Subject: [PATCH] Use maximum channel offset instead of set length for determining break length This should fix unexpected behavior when gdtf files are missing channels --- pygdtf/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygdtf/__init__.py b/pygdtf/__init__.py index cadd406..75d24aa 100644 --- a/pygdtf/__init__.py +++ b/pygdtf/__init__.py @@ -1388,7 +1388,7 @@ def _read_xml(self, xml_node: "Element", xml_parent: Optional["Element"] = None) grouped_breaks[key] += channel.offset self.dmx_breaks = [ - DmxModeBreak(dmx_break, len(set(channel_offsets))) + DmxModeBreak(dmx_break, max(channel_offsets)) for dmx_break, channel_offsets in grouped_breaks.items() ]