Skip to content

Commit

Permalink
refactor(Audio): Do not print "?"/"Unknown" values in str()
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Apr 14, 2024
1 parent 57b042f commit 8ca91ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions devine/core/tracks/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ def __init__(self, *args: Any, codec: Audio.Codec, bitrate: Union[str, int, floa
def __str__(self) -> str:
return " | ".join(filter(bool, [
"AUD",
f"[{self.codec.value}]",
f"[{self.codec.value}]" if self.codec else None,
str(self.language),
str(self.channels or "?") + (f" (JOC {self.joc})" if self.joc else ""),
f"{self.bitrate // 1000 if self.bitrate else '?'} kb/s",
", ".join(filter(bool, [
str(self.channels) if self.channels else None,
f"JOC {self.joc}" if self.joc else None,
])),
f"{self.bitrate // 1000} kb/s" if self.bitrate else None,
self.get_track_name(),
self.edition
]))
Expand Down

0 comments on commit 8ca91ef

Please sign in to comment.