comment out more unused code

This commit is contained in:
Karl 2024-01-08 12:54:11 +00:00
parent 295918a129
commit b08966cd5f

View File

@ -11,14 +11,14 @@ from utils.whisper import WhisperAI
def process(args: dict): def process(args: dict):
model_name: str = args.pop("model") model_name: str = args.pop("model")
output_dir: str = args.pop("output_dir") # output_dir: str = args.pop("output_dir")
output_srt: bool = args.pop("output_srt") # output_srt: bool = args.pop("output_srt")
srt_only: bool = args.pop("srt_only") # srt_only: bool = args.pop("srt_only")
language: str = args.pop("language") language: str = args.pop("language")
sample_interval: str = args.pop("sample_interval") sample_interval: str = args.pop("sample_interval")
audio_channel: str = args.pop('audio_channel') audio_channel: str = args.pop('audio_channel')
os.makedirs(output_dir, exist_ok=True) # os.makedirs(output_dir, exist_ok=True)
if model_name.endswith(".en"): if model_name.endswith(".en"):
warnings.warn( warnings.warn(
@ -39,11 +39,11 @@ def process(args: dict):
print(f"Processing {episode['seriesTitle']} - {episode['episode_number']}") print(f"Processing {episode['seriesTitle']} - {episode['episode_number']}")
episode_data = get_episode_details(episode['sonarrEpisodeId']) episode_data = get_episode_details(episode['sonarrEpisodeId'])
audios = get_audio([episode_data['path']], audio_channel, sample_interval) audios = get_audio([episode_data['path']], audio_channel, sample_interval)
srt_output_dir = output_dir if output_srt or srt_only else tempfile.gettempdir() # srt_output_dir = output_dir if output_srt or srt_only else tempfile.gettempdir()
subtitles = get_subtitles(audios, srt_output_dir, model_args, args) subtitles = get_subtitles(audios, tempfile.gettempdir(), model_args, args)
if srt_only: # if srt_only:
return # return
add_subs_new(subtitles) add_subs_new(subtitles)
update_show_in_soarr(episode['sonarrSeriesId']) update_show_in_soarr(episode['sonarrSeriesId'])