fix(fastapi): improves presentation export fetch assets to not fetch local app_data files

This commit is contained in:
sauravniraula 2025-07-28 18:25:04 +05:45
parent d15d0960d0
commit 4ccf071be6
No known key found for this signature in database
GPG key ID: 60FCC1B5A5E83326

View file

@ -73,10 +73,10 @@ class PptxPresentationCreator:
if isinstance(each_shape, PptxPictureBoxModel):
image_path = each_shape.picture.path
if image_path.startswith("http"):
if "app_data/images" in image_path:
relative_path = image_path.split("/app_data/images/")[1]
if "app_data/" in image_path:
relative_path = image_path.split("/app_data/")[1]
each_shape.picture.path = os.path.join(
"app_data/images", relative_path
"app_data", relative_path
)
each_shape.picture.is_network = False
continue
@ -88,10 +88,10 @@ class PptxPresentationCreator:
if isinstance(each_shape, PptxPictureBoxModel):
image_path = each_shape.picture.path
if image_path.startswith("http"):
if "app_data/images" in image_path:
relative_path = image_path.split("/app_data/images/")[1]
if "app_data" in image_path:
relative_path = image_path.split("/app_data/")[1]
each_shape.picture.path = os.path.join(
"app_data/images", relative_path
"app_data", relative_path
)
each_shape.picture.is_network = False
continue