Skip to content

Commit

Permalink
Merge pull request #100 from retouching/patch-1
Browse files Browse the repository at this point in the history
Check if width and height is digit if it's an str
  • Loading branch information
rlaphoenix committed Apr 16, 2024
2 parents a850a35 + cbcb7e3 commit 3abb869
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ Please refrain from spam or asking for questions that infringe upon a Service's
<a href="https://github.com/Hollander-1908"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/93162595?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Hollander-1908"/></a>
<a href="https://github.com/Shivelight"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/20620780?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Shivelight"/></a>
<a href="https://github.com/knowhere01"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/113712042?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="knowhere01"/></a>
<a href="https://github.com/retouching"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/33735357?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="retouching"/></a>

## Licensing

Expand Down
8 changes: 4 additions & 4 deletions devine/core/tracks/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ def __init__(
raise TypeError(f"Expected range_ to be a {Video.Range}, not {range_!r}")
if not isinstance(bitrate, (str, int, float, type(None))):
raise TypeError(f"Expected bitrate to be a {str}, {int}, or {float}, not {bitrate!r}")
if not isinstance(width, (int, type(None))):
if not isinstance(width, (int, str, type(None))):
raise TypeError(f"Expected width to be a {int}, not {width!r}")
if not isinstance(height, (int, type(None))):
if not isinstance(height, (int, str, type(None))):
raise TypeError(f"Expected height to be a {int}, not {height!r}")
if not isinstance(fps, (str, int, float, type(None))):
raise TypeError(f"Expected fps to be a {str}, {int}, or {float}, not {fps!r}")
Expand All @@ -212,12 +212,12 @@ def __init__(
try:
self.width = int(width or 0) or None
except ValueError as e:
raise ValueError(f"Expected width to be a number, {e}")
raise ValueError(f"Expected width to be a number, not {width!r}, {e}")

try:
self.height = int(height or 0) or None
except ValueError as e:
raise ValueError(f"Expected height to be a number, {e}")
raise ValueError(f"Expected height to be a number, not {height!r}, {e}")

try:
self.fps = (FPS.parse(str(fps)) or None) if fps else None
Expand Down

0 comments on commit 3abb869

Please sign in to comment.