Skip to content

Commit

Permalink
fix: wrongly grouping display sets, fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
ratoaq2 committed Mar 3, 2023
1 parent ffc5eb5 commit ea8e7f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pgsrip/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def create_items(media_path: MediaPath, display_sets: typing.Iterable[DisplaySet
index = 0
candidates: typing.List[PgsSubtitleItem] = []
for ds in display_sets:
if current_sets and ds.is_epoch_start():
if current_sets and ds.is_start():
candidates.append(PgsSubtitleItem(index, media_path, current_sets))
current_sets = []
index += 1
Expand All @@ -61,7 +61,7 @@ def create_items(media_path: MediaPath, display_sets: typing.Iterable[DisplaySet
@staticmethod
def generate_image(display_sets: typing.Iterable[DisplaySet]):
for ds in display_sets:
if not ds.pcs.is_epoch_start():
if not ds.pcs.is_start():
continue

palettes: typing.List[Palette] = []
Expand Down
8 changes: 4 additions & 4 deletions pgsrip/pgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ def attributes(self):
'num_objects': 'number_composition_objects'
}

def is_epoch_start(self):
return self.composition_state == CompositionState.EPOCH_START
def is_start(self):
return self.composition_state in (CompositionState.EPOCH_START, CompositionState.ACQUISITION_POINT)


class WindowDefinitionSegment(BaseSegment):
Expand Down Expand Up @@ -414,8 +414,8 @@ def ods_segments(self):
def end(self):
return [s for s in self.segments if isinstance(s, EndSegment)][0]

def is_epoch_start(self):
return self.pcs.is_epoch_start()
def is_start(self):
return self.pcs.is_start()

def is_valid(self):
valid = True
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pgsrip"
version = "0.1.8"
version = "0.1.9"
description = "Rip your PGS subtitles"
authors = [
"Rato",
Expand Down

0 comments on commit ea8e7f9

Please sign in to comment.