Spaces:
Running
Running
jhj0517
commited on
Commit
·
44a8350
1
Parent(s):
7ff9bba
Remove redundant safe filename logic
Browse files
modules/utils/subtitle_manager.py
CHANGED
@@ -119,11 +119,8 @@ def get_serialized_vtt(dicts):
|
|
119 |
|
120 |
|
121 |
def safe_filename(name):
|
122 |
-
from app import _args
|
123 |
INVALID_FILENAME_CHARS = r'[<>:"/\\|?*\x00-\x1f]'
|
124 |
safe_name = re.sub(INVALID_FILENAME_CHARS, '_', name)
|
125 |
-
if not _args.colab:
|
126 |
-
return safe_name
|
127 |
# Truncate the filename if it exceeds the max_length (20)
|
128 |
if len(safe_name) > 20:
|
129 |
file_extension = safe_name.split('.')[-1]
|
|
|
119 |
|
120 |
|
121 |
def safe_filename(name):
|
|
|
122 |
INVALID_FILENAME_CHARS = r'[<>:"/\\|?*\x00-\x1f]'
|
123 |
safe_name = re.sub(INVALID_FILENAME_CHARS, '_', name)
|
|
|
|
|
124 |
# Truncate the filename if it exceeds the max_length (20)
|
125 |
if len(safe_name) > 20:
|
126 |
file_extension = safe_name.split('.')[-1]
|