style: Format code with linter

This commit is contained in:
Paul Gauthier (aider) 2025-03-14 18:52:47 -07:00
parent 8404165db3
commit 791dc213fa

View file

@ -94,6 +94,7 @@ def load_metadata(output_dir):
return {}
def save_metadata(output_dir, metadata):
"""Save the audio metadata to JSON file."""
metadata_file = os.path.join(output_dir, "metadata.json")
@ -101,12 +102,14 @@ def save_metadata(output_dir, metadata):
with open(metadata_file, "w") as f:
json.dump(metadata, f, indent=2)
def get_timestamp_key(time_sec):
"""Generate a consistent timestamp key format for metadata."""
minutes = time_sec // 60
seconds = time_sec % 60
return f"{minutes:02d}-{seconds:02d}"
def main():
parser = argparse.ArgumentParser(description="Generate TTS audio for recording commentary.")
parser.add_argument("markdown_file", help="Path to the recording markdown file")
@ -176,8 +179,7 @@ def main():
# Check if we need to generate this file
needs_update = args.force or (
timestamp_key not in metadata or
metadata[timestamp_key] != message
timestamp_key not in metadata or metadata[timestamp_key] != message
)
minutes = time_sec // 60