cool patch with 5 lines of code

This commit is contained in:
2025-08-11 13:58:54 +03:00
parent 0984e169eb
commit 1d0ef1535f
2 changed files with 6 additions and 2 deletions

View File

@@ -108,7 +108,11 @@ class WebServer:
elif os.path.isdir(file_path):
resp = ""
async with aiofiles.open(config.preset_file, "r", encoding="utf-8") as f:
if os.path.isfile(os.path.join(file_path, "preset.html")):
preset_file = os.path.join(file_path, "preset.html")
else:
preset_file = config.preset_file
async with aiofiles.open(preset_file, "r", encoding="utf-8") as f:
resp = await f.read()
files = ""