Remove deprecated code thing

This commit is contained in:
Nexus 2024-02-10 01:57:03 +00:00
parent 2677e645b1
commit de62b09437
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -1,3 +1,4 @@
import contextlib
import io
import json
import os
@ -124,7 +125,7 @@ CACHE_FILE = CACHE_DIR / "db.sqlite3"
logging.debug("Cache file: %r", CACHE_FILE)
@app.on_event("startup")
@contextlib.asynccontextmanager
async def startup():
if not CACHE_DIR.exists():
CACHE_DIR.mkdir(parents=True)
@ -139,6 +140,7 @@ async def startup():
)
"""
)
yield
def upload_media(domain: str, access_token: str, file: io.BytesIO, filename: str, content_type: str):
@ -196,7 +198,7 @@ def preview_url(
cursor = conn.cursor()
cursor.execute(
"SELECT metadata,ts FROM cache WHERE url = ?",
(url, ts)
(url,)
)
results = cursor.fetchall()
if results: