Fix sound length metadata having no formatting.

This commit is contained in:
csd4ni3l
2025-06-26 22:06:07 +02:00
parent ad51f1236f
commit 716ebfa021
2 changed files with 20 additions and 3 deletions

View File

@@ -301,4 +301,21 @@ def adjust_volume(input_path, volume):
change = volume - audio.dBFS
audio.apply_gain(change)
audio.export(input_path, **export_args)
audio.export(input_path, **export_args)
def convert_seconds_to_date(seconds):
days, remainder = divmod(seconds, 86400)
hours, remainder = divmod(remainder, 3600)
minutes, seconds = divmod(remainder, 60)
result = ""
if days > 0:
result += "{} days ".format(int(days))
if hours > 0:
result += "{} hours ".format(int(hours))
if minutes > 0:
result += "{} minutes ".format(int(minutes))
if seconds > 0 or not any([days, hours, minutes]):
result += "{} seconds".format(int(seconds))
return result.strip()