diff --git a/TFC/__init__.py b/TFC/__init__.py index 7a7b878..9e56fe5 100644 --- a/TFC/__init__.py +++ b/TFC/__init__.py @@ -259,11 +259,14 @@ class TFC(Service): # Sort the cuepoints sorted_cuepoints = sorted(cuepoints, key=lambda x: datetime.strptime(x, "%H:%M:%S.%f")) - chapters = [] - for i, cuepoint in enumerate(sorted_cuepoints): + chapters = [ + Chapter(name="Chapter 1", timestamp="00:00:00.000") + ] + + for i, cuepoint in enumerate(sorted_cuepoints, start=2): try: timestamp = datetime.strptime(cuepoint, "%H:%M:%S.%f").time() - chapters.append(Chapter(name=f"Chapter {i + 1}", timestamp=timestamp.strftime("%H:%M:%S.%f")[:-3])) + chapters.append(Chapter(name=f"Chapter {i}", timestamp=timestamp.strftime("%H:%M:%S.%f")[:-3])) except ValueError: self.log.warning(f"Invalid cuepoint format: {cuepoint}")