From 6881839e31dc6ccfed3f0adc890da57edefe9678 Mon Sep 17 00:00:00 2001 From: ubuntu Date: Sun, 30 Aug 2026 23:29:04 +0000 Subject: [PATCH] Fix crashing /init_db and remove dead proxy_image handler /init_db dropped the channels/playlists collections then crashed on an undefined `res` variable, so the "Reset DB" button in the UI always surfaced a 500 even though the wipe had already happened. proxy_image used aiohttp.ClientSession without importing aiohttp and was never routed or called from the frontend, so it's just removed. Co-Authored-By: Claude Sonnet 5 --- server.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/server.py b/server.py index c5a7054..3e008a5 100644 --- a/server.py +++ b/server.py @@ -440,7 +440,7 @@ async def init_db(request): db_iptv.drop_collection("channels") db_iptv.drop_collection("playlists") - return web.Response(text=str(res),content_type='text/html') + return web.json_response({'status': 'ok'}) @@ -1138,19 +1138,6 @@ async def get_logo(request): return web.Response(body=image_data, content_type="image/jpeg") -async def proxy_image(request): - url = request.query.get("url") - if not url: - return web.Response(status=400, text="Missing URL") - - async with aiohttp.ClientSession() as session: - async with session.get(url) as resp: - if resp.status == 200: - headers = {"Content-Type": resp.headers["Content-Type"]} - return web.Response(body=await resp.read(), headers=headers) - else: - return web.Response(status=resp.status) - async def list_logo(request): result = logos.find({}).limit(1000) search_string = "harry potter"