From f04747d2dd5b165c49dda3d35f4e89ba25bb174c Mon Sep 17 00:00:00 2001 From: Bleuzen Date: Wed, 17 Feb 2021 21:24:05 +0100 Subject: [PATCH] add types for FFmpeg.record function, use pathlib to create main out dir --- spotrec.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spotrec.py b/spotrec.py index 1d2e086..a8a838b 100755 --- a/spotrec.py +++ b/spotrec.py @@ -77,7 +77,8 @@ def main(): init_log() # Create the output directory - os.makedirs(_output_directory, exist_ok=True) + Path(_output_directory).mkdir( + parents=True, exist_ok=True) # Init Spotify DBus listener global _spotify @@ -434,7 +435,7 @@ def init_pa_stuff_if_needed(self): class FFmpeg: instances = [] - def record(self, out_dir, file, metadata_for_file={}): + def record(self, out_dir: str, file: str, metadata_for_file={}): self.out_dir = out_dir self.pulse_input = _pa_recording_sink_name + ".monitor"