diff --git a/pbp/job_agent/job_agent.py b/pbp/job_agent/job_agent.py index f003d4f..6de4683 100644 --- a/pbp/job_agent/job_agent.py +++ b/pbp/job_agent/job_agent.py @@ -146,35 +146,35 @@ def synth_pbp_meta_gen( command = "pbp-meta-gen" # Check if recorder is not None or an empty string - if recorder and recorder != "": + if recorder not in [None, ""]: command += f" --recorder {recorder}" # Check if uri is not None or an empty string - if uri and uri != "": + if uri not in [None, ""]: command += f" --uri {uri}" # Check if output_dir is not None or an empty string - if output_dir and output_dir != "": + if output_dir not in [None, ""]: command += f" --output-dir {output_dir}" # Check if json_base_dir is not None or an empty string - if json_base_dir and json_base_dir != "": + if json_base_dir not in [None, ""]: command += f" --json-base-dir {json_base_dir}" # Check if xml_dir is not None or an empty string - if xml_dir and xml_dir != "": + if xml_dir not in [None, ""]: command += f" --xml-dir {xml_dir}" # Check if start is not None or an empty string - if start and start != "": + if start not in [None, ""]: command += f" --start {start}" # Check if end is not None or an empty string - if end and end != "": + if end not in [None, ""]: command += f" --end {end}" # Check if prefix is not None or an empty string - if prefix and prefix != "": + if prefix not in [None, ""]: command += f" --prefix {prefix}" return command diff --git a/pbp/meta_gen/gen_soundtrap.py b/pbp/meta_gen/gen_soundtrap.py index 69b908f..a13a489 100644 --- a/pbp/meta_gen/gen_soundtrap.py +++ b/pbp/meta_gen/gen_soundtrap.py @@ -88,19 +88,22 @@ def run(self): start_dt = self.start - timedelta(days=1) end_dt = self.end + timedelta(days=1) - if scheme == "file": - parsed_uri = urllib.parse.urlparse(self.audio_loc) - + if scheme == "file" or scheme == "": + #parsed_uri = urllib.parse.urlparse(self.audio_loc) if os.name == "nt": - wav_path = Path(parsed_uri.path[3:]) + #wav_path = Path(parsed_uri.path[3:]) + wav_path = Path(self.audio_loc) else: - wav_path = Path(parsed_uri.path) + wav_path = Path(self.audio_loc) for filename in progressbar( sorted(wav_path.rglob("*.wav")), prefix="Searching : " ): + xml_path = os.path.join(self.xml_dir, f"{filename.stem}.log.xml"), + print("xml_path", xml_path) wav_path = filename.parent / f"{filename.stem}.wav" xml_path = Path(self.xml_dir + "/" + f"{filename.stem}.log.xml") + print("xml_path", xml_path) start_dt = get_datetime(wav_path, self.prefixes) # Must have a start date to be valid and also must have a corresponding xml file