Skip to content

Commit d5e04a1

Browse files
authored
fix: The image uploaded from the workflow knowledge base zip file cannot be parsed (#4509)
1 parent 61a5303 commit d5e04a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/common/handle/impl/text/text_split_handle.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@
2525
re.compile("(?<=\\n)(?<!#)###### (?!#).*|(?<=^)(?<!#)###### (?!#).*")
2626
]
2727

28+
end = [".mp4", ".avi", ".mov", ".mkv", ".flv", ".wmv", ".webm", ".mpeg", ".mpg", ".3gp", ".ts", ".rmvb",
29+
".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".wma", ".opus", ".alac", ".aiff", ".amr",
30+
".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".webp", ".heif", ".raw", ".ico", ".svg", ".pdf"]
31+
2832

2933
class TextSplitHandle(BaseSplitHandle):
3034
def support(self, file, get_buffer):
3135
file_name: str = file.name.lower()
3236
if file_name.endswith(".md") or file_name.endswith('.txt') or file_name.endswith('.TXT') or file_name.endswith(
3337
'.MD'):
3438
return True
35-
if '.' in file_name:
39+
lower_name = file_name.lower()
40+
if any([True for item in end if lower_name.endswith(item)]):
3641
return False
3742
buffer = get_buffer(file)
3843
result = detect(buffer)

0 commit comments

Comments
 (0)