Skip to content

Commit

Permalink
logger.debug, move orig file path assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
yajrendrag committed Oct 15, 2024
1 parent f8f97e4 commit dd149ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion source/subtitle_from_audio/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

**<span style="color:#56adda">0.0.12</span>**
- added logger.debug
- moved original_file_path assignment statement to avoid using before defined

**<span style="color:#56adda">0.0.11</span>**
- writ srt file to the destination directory
- write srt file to the destination directory

**<span style="color:#56adda">0.0.10</span>**
- use lang names in post processor to determine if configured lang is in file so that srt file is saved with lang code
Expand Down
2 changes: 1 addition & 1 deletion source/subtitle_from_audio/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"on_worker_process": 2
},
"tags": "subtitle",
"version": "0.0.11"
"version": "0.0.12"
}
6 changes: 5 additions & 1 deletion source/subtitle_from_audio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def on_worker_process(data):

# Get the path to the file
abspath = data.get('file_in')
original_file_path = data.get('original_file_path')

# Get file probe
probe_data = Probe(logger, allowed_mimetypes=['video'])
Expand All @@ -254,15 +255,18 @@ def on_worker_process(data):
settings = Settings()

srt_exists, audio_language_to_convert = srt_already_created(settings, abspath, probe_streams)
logger.debug("srt_exists: '{}', audio_language_to_convert: '{}'".format(srt_exists, audio_language_to_convert))

if not srt_exists and audio_language_to_convert != "":
lang_in_model = lang_code_to_name(audio_language_to_convert)
logger.debug("lang_in_model: '{}'".format(lang_in_model))

if lang_in_model:
try:
duration = float(probe_format["duration"])
except KeyError:
duration = 0.0

original_file_path = data.get('original_file_path')
output_dir = os.path.dirname(original_file_path)
split_original_file_path = os.path.splitext(original_file_path)

Expand Down

0 comments on commit dd149ef

Please sign in to comment.