mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-15 07:34:48 -04:00
Catch enabling conversion without specifying codec
Signed-off-by: nathom <nathanthomas707@gmail.com>
This commit is contained in:
parent
14710d536a
commit
df29a338c6
2 changed files with 14 additions and 7 deletions
|
@ -570,7 +570,14 @@ class Track:
|
|||
"M4A": converter.AAC,
|
||||
}
|
||||
|
||||
try:
|
||||
self.container = codec.upper()
|
||||
except AttributeError:
|
||||
click.secho(
|
||||
"Error: No audio codec chosen to convert to.", fg="red"
|
||||
)
|
||||
raise click.Abort
|
||||
|
||||
if not hasattr(self, "final_path"):
|
||||
self.format_final_path()
|
||||
|
||||
|
|
|
@ -242,12 +242,12 @@ class Album(Tracklist):
|
|||
"""
|
||||
fmt = {key: self.get(key) for key in ALBUM_KEYS}
|
||||
|
||||
max_bd, max_sr = get_stats_from_quality(self.quality)
|
||||
if max_sr < fmt.get("sampling_rate", 0) or max_bd < fmt.get(
|
||||
"bit_depth", 0
|
||||
):
|
||||
fmt["sampling_rate"] = max_sr
|
||||
fmt["bit_depth"] = max_bd
|
||||
stats = get_stats_from_quality(self.quality)
|
||||
|
||||
# The quality chosen is not the maximum available quality
|
||||
if stats != (fmt.get("sampling_rate"), fmt.get("bit_depth")):
|
||||
fmt["bit_depth"] = stats[0]
|
||||
fmt["sampling_rate"] = stats[1]
|
||||
|
||||
if sr := fmt.get("sampling_rate"):
|
||||
if sr % 1000 == 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue