Skip to content

Commit

Permalink
fix(Video): Ensure track is supported in change_color_range()
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Apr 14, 2024
1 parent 20da213 commit dae83b0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion devine/core/tracks/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ def __str__(self) -> str:
def change_color_range(self, range_: int) -> None:
"""Change the Video's Color Range to Limited (0) or Full (1)."""
if not self.path or not self.path.exists():
raise ValueError("Cannot repackage a Track that has not been downloaded.")
raise ValueError("Cannot change the color range flag on a Video that has not been downloaded.")
if not self.codec:
raise ValueError("Cannot change the color range flag on a Video that has no codec specified.")
if self.codec not in (Video.Codec.AVC, Video.Codec.HEVC):
raise NotImplementedError(
"Cannot change the color range flag on this Video as "
f"it's codec, {self.codec.value}, is not yet supported."
)

executable = get_binary_path("ffmpeg")
if not executable:
Expand Down

0 comments on commit dae83b0

Please sign in to comment.