From 37f3b28680ae13a377f3838ed482fc9c24835483 Mon Sep 17 00:00:00 2001
From: anapnoe <124302297+anapnoe@users.noreply.github.com>
Date: Tue, 16 May 2023 18:39:44 +0300
Subject: [PATCH] extra networks ext lower
---
html/extra-networks-card.html | 2 +-
modules/ui_extra_networks.py | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/html/extra-networks-card.html b/html/extra-networks-card.html
index 043939d5577..d464a221e44 100644
--- a/html/extra-networks-card.html
+++ b/html/extra-networks-card.html
@@ -1,5 +1,5 @@
-
+
{metadata_button}
diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py
index 385ad8d6c24..4d5a0e58a28 100644
--- a/modules/ui_extra_networks.py
+++ b/modules/ui_extra_networks.py
@@ -30,8 +30,11 @@ def fetch_file(filename: str = ""):
if not any([Path(x).absolute() in Path(filename).absolute().parents for x in allowed_dirs]):
raise ValueError(f"File cannot be fetched: {filename}. Must be in one of directories registered by extra pages.")
- extbase = os.path.basename(filename)
- ext = os.path.splitext(extbase).lower()
+
+ ext = os.path.splitext(filename)[1]
+ if ext:
+ ext = ext.lower()
+
if ext not in (".png", ".jpg", ".webp"):
raise ValueError(f"File cannot be fetched: {filename}. Only png and jpg and webp.")