feat: add favicon to Castbox web interface using relative path lookup

This commit is contained in:
pstruebi
2025-09-22 13:34:22 +02:00
parent 0201222bca
commit f82febc1ce
2 changed files with 11 additions and 4 deletions

View File

@@ -1,11 +1,14 @@
# frontend/app.py
import os
import time
import streamlit as st
import requests
from auracast import auracast_config
import logging as log
from PIL import Image
import requests
from dotenv import load_dotenv
import streamlit as st
from auracast import auracast_config
from auracast.utils.frontend_auth import (
is_pw_disabled,
load_pw_record,
@@ -15,7 +18,11 @@ from auracast.utils.frontend_auth import (
)
# Set page configuration (tab title and icon) before using other Streamlit APIs
st.set_page_config(page_title="Castbox", page_icon="", layout="centered")
# Always use the favicon from the utils folder relative to this file
_THIS_DIR = os.path.dirname(__file__)
_FAVICON_PATH = os.path.abspath(os.path.join(_THIS_DIR, '..', 'utils', 'favicon.ico'))
favicon = Image.open(_FAVICON_PATH)
st.set_page_config(page_title="Castbox", page_icon=favicon, layout="centered")
# Load environment variables from a .env file if present
load_dotenv()

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB