refactor(Audio): Do not print "?"/"Unknown" values in str()

This commit is contained in:
rlaphoenix 2024-04-14 03:12:50 +01:00
parent 57b042fa4b
commit 8ca91efbc5
1 changed files with 6 additions and 3 deletions

View File

@ -79,10 +79,13 @@ class Audio(Track):
def __str__(self) -> str: def __str__(self) -> str:
return " | ".join(filter(bool, [ return " | ".join(filter(bool, [
"AUD", "AUD",
f"[{self.codec.value}]", f"[{self.codec.value}]" if self.codec else None,
str(self.language), str(self.language),
str(self.channels or "?") + (f" (JOC {self.joc})" if self.joc else ""), ", ".join(filter(bool, [
f"{self.bitrate // 1000 if self.bitrate else '?'} kb/s", 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.get_track_name(),
self.edition self.edition
])) ]))