mirror of
https://github.com/Dasemu/Transcriptarr.git
synced 2026-11-26 15:06:06 +00:00
Fix double task_done in ASR/detect-language handlers (#262)
This commit is contained in:
1 parent
11cca018ae
commit
ad0bdba03d
1 file changed
+4
-4
@@ -1,4 +1,4 @@
|
||||
subgen_version = '2026.01.4'
|
||||
subgen_version = '2026.01.5'
|
||||
|
||||
"""
|
||||
ENVIRONMENT VARIABLES DOCUMENTATION
|
||||
@@ -586,8 +586,7 @@ async def asr(
|
||||
|
||||
finally:
|
||||
await audio_file.close()
|
||||
task_queue.task_done()
|
||||
()
|
||||
delete_model()
|
||||
|
||||
if result:
|
||||
return StreamingResponse(
|
||||
@@ -666,7 +665,6 @@ async def detect_language(
|
||||
|
||||
finally:
|
||||
#await audio_file.close()
|
||||
task_queue.task_done()
|
||||
delete_model()
|
||||
|
||||
return {"detected_language": detected_language.to_name(), "language_code": language_code}
|
||||
@@ -1142,6 +1140,7 @@ def find_language_audio_track(audio_tracks, find_languages):
|
||||
if track['language'] == language:
|
||||
return language
|
||||
return None
|
||||
|
||||
def find_default_audio_track_language(audio_tracks):
|
||||
"""
|
||||
Finds the language of the default audio track in the given list of audio tracks.
|
||||
@@ -1258,6 +1257,7 @@ def should_skip_file(file_path: str, target_language: LanguageCode) -> bool:
|
||||
logging.debug(f"Processing {base_name}: No skip conditions met.")
|
||||
return False
|
||||
|
||||
|
||||
def get_subtitle_languages(video_path):
|
||||
"""
|
||||
Extract language codes from each audio stream in the video file using pyav.
|
||||
|
||||
Reference in new issue
Block a user