kphfrepo commited on
Commit
a5fc2ee
·
verified ·
1 Parent(s): fb015e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -199,12 +199,9 @@ with gr.Blocks(title="CCTV Ultimate Explorer", theme=gr.themes.Soft(), js=custom
199
  html_buffer.append('<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 25px; width: 100%;">')
200
 
201
  for img_item in media["images"]:
202
- # public_image_url = f"https://kphfrepo-httpBucket.hf.space{img_item['image_url']}"
203
- absolute_local_path = os.path.abspath(os.path.join(DEFAULT_DIR, img_item['image_url'].lstrip('/')))
204
- public_image_url = f"/file={absolute_local_path}"
205
- print(f"{img_item['image_url']}" )
206
- # img_path = img_item['image_url'].lstrip('/')
207
- # public_image_url = f"{WEBDAV_BASE_URL}/{img_path}"
208
  html_buffer.append(f"""
209
  <div style="border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #0f172a; height: 160px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.025);">
210
  <img src="{public_image_url}" loading="lazy" style="max-width: 100%; max-height: 100%; object-fit: contain; display: block;" />
 
199
  html_buffer.append('<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 25px; width: 100%;">')
200
 
201
  for img_item in media["images"]:
202
+ # public_image_url = f"https://kphfrepo-httpBucket.hf.space{img_item['image_url']}"
203
+ img_path = img_item['image_url'].lstrip('/')
204
+ public_image_url = f"{WEBDAV_BASE_URL}/{img_path}"
 
 
 
205
  html_buffer.append(f"""
206
  <div style="border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #0f172a; height: 160px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.025);">
207
  <img src="{public_image_url}" loading="lazy" style="max-width: 100%; max-height: 100%; object-fit: contain; display: block;" />