fix resolve_prompt
This commit is contained in:
parent
cbcf934a89
commit
5e7aff4d7f
1 changed files with 5 additions and 5 deletions
|
@ -92,7 +92,7 @@ class TranslatorApp:
|
||||||
""" Resolve which prompt to use based on options """
|
""" Resolve which prompt to use based on options """
|
||||||
if options.get('custom_prompt'):
|
if options.get('custom_prompt'):
|
||||||
return options['custom_prompt'].strip()
|
return options['custom_prompt'].strip()
|
||||||
elif options.get('prompts.py'):
|
elif options.get('prompt'):
|
||||||
results = self.prompts.search_prompts(options['prompt'].strip())
|
results = self.prompts.search_prompts(options['prompt'].strip())
|
||||||
if results:
|
if results:
|
||||||
if len(results) == 1:
|
if len(results) == 1:
|
||||||
|
@ -116,10 +116,10 @@ class TranslatorApp:
|
||||||
default_lang, default_batch_size = self.settings.get_translation_config()
|
default_lang, default_batch_size = self.settings.get_translation_config()
|
||||||
api_key = self.settings.get_api_key()
|
api_key = self.settings.get_api_key()
|
||||||
|
|
||||||
input_path = Path(options.get('input_path', input_dir))
|
input_path = Path(options.get('input_path') or input_dir)
|
||||||
output_path = Path(options.get('output_path', output_dir))
|
output_path = Path(options.get('output_path') or output_dir)
|
||||||
language = options.get('language', default_lang)
|
language = options.get('language') or default_lang
|
||||||
batch_size = options.get('batch_size', default_batch_size)
|
batch_size = options.get('batch_size') or default_batch_size
|
||||||
|
|
||||||
if not api_key:
|
if not api_key:
|
||||||
print("❌ No API key found. Use 'subtitle-translator settings' to configure.")
|
print("❌ No API key found. Use 'subtitle-translator settings' to configure.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue