Update subgen.py
This commit is contained in:
@@ -615,15 +615,16 @@ def path_mapping(fullpath):
|
|||||||
return fullpath.replace(path_mapping_from, path_mapping_to)
|
return fullpath.replace(path_mapping_from, path_mapping_to)
|
||||||
return fullpath
|
return fullpath
|
||||||
|
|
||||||
# Define a handler class that will process new files
|
if monitor:
|
||||||
class NewFileHandler(FileSystemEventHandler):
|
# Define a handler class that will process new files
|
||||||
def on_created(self, event):
|
class NewFileHandler(FileSystemEventHandler):
|
||||||
# Only process if it's a file
|
def on_created(self, event):
|
||||||
if not event.is_directory:
|
# Only process if it's a file
|
||||||
file_path = event.src_path
|
if not event.is_directory:
|
||||||
# Call the gen_subtitles function
|
file_path = event.src_path
|
||||||
logging.info(f"File: {path_mapping(file_path)} was added")
|
# Call the gen_subtitles function
|
||||||
gen_subtitles(path_mapping(file_path), transcribe_or_translate, False)
|
logging.info(f"File: {path_mapping(file_path)} was added")
|
||||||
|
gen_subtitles(path_mapping(file_path), transcribe_or_translate, False)
|
||||||
|
|
||||||
def transcribe_existing(transcribe_folders, forceLanguage=None):
|
def transcribe_existing(transcribe_folders, forceLanguage=None):
|
||||||
transcribe_folders = transcribe_folders.split("|")
|
transcribe_folders = transcribe_folders.split("|")
|
||||||
|
|||||||
Reference in New Issue
Block a user