Skip to content

Commit d49f448

Browse files
committed
fix: correct image path replacement logic in zip_split_handle
1 parent 6b167d7 commit d49f448

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ def get_image_list(result_list: list, zip_files: List[str]):
8585
if not zip_files.__contains__(image_path):
8686
continue
8787
if image_path.startswith('oss/file/') or image_path.startswith('oss/image/'):
88-
image_id = image_path.replace('oss/file/', '').replace('oss/image/', '')
88+
image_id = image_path.replace('oss/file/', '').replace('oss/file/', '')
8989
if is_valid_uuid(image_id):
9090
image_file_list.append({'source_file': image_path,
9191
'image_id': image_id})
9292
else:
9393
image_file_list.append({'source_file': image_path,
9494
'image_id': new_image_id})
95-
content = content.replace(source_image_path, f'/oss/image/{new_image_id}')
95+
content = content.replace(source_image_path, f'/oss/file/{new_image_id}')
9696
p['content'] = content
9797
else:
9898
image_file_list.append({'source_file': image_path,
9999
'image_id': new_image_id})
100-
content = content.replace(source_image_path, f'/oss/image/{new_image_id}')
100+
content = content.replace(source_image_path, f'/oss/file/{new_image_id}')
101101
p['content'] = content
102102

103103
return image_file_list

0 commit comments

Comments
 (0)