Skip to content

Commit

Permalink
extra networks ext lower
Browse files Browse the repository at this point in the history
  • Loading branch information
anapnoe committed May 16, 2023
1 parent caae553 commit 37f3b28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion html/extra-networks-card.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class='card-container' >
<div class='card' onclick={card_clicked}><!--{preview_html}-->
<div class='card' onclick={card_clicked}>
<img src={preview_image} loading="lazy">
{metadata_button}
<div class='actions'>
Expand Down
7 changes: 5 additions & 2 deletions modules/ui_extra_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down

0 comments on commit 37f3b28

Please sign in to comment.