|
1 | | -from fastapi import FastAPI, Request |
2 | | -from fastapi.templating import Jinja2Templates |
3 | | -from fastapi.staticfiles import StaticFiles |
4 | | -from fastapi.responses import FileResponse, HTMLResponse |
5 | | -from beetsstatistics import AlbumSort, BeetsStatistics, DBNotFoundError, DBQueryError |
6 | | -import humanize |
7 | | -from fastapi import Depends |
8 | | -from typing import Annotated |
9 | | -from pydantic_settings import BaseSettings |
10 | | -from fastapi import HTTPException |
11 | 1 | import logging |
| 2 | +from typing import Annotated |
12 | 3 | from urllib.parse import quote_plus |
13 | 4 |
|
| 5 | +import humanize |
| 6 | +from fastapi import Depends, FastAPI, HTTPException, Request |
| 7 | +from fastapi.responses import FileResponse, HTMLResponse |
| 8 | +from fastapi.staticfiles import StaticFiles |
| 9 | +from fastapi.templating import Jinja2Templates |
| 10 | +from pydantic_settings import BaseSettings |
| 11 | + |
| 12 | +from beetsstatistics import AlbumSort, BeetsStatistics, DBNotFoundError, DBQueryError |
| 13 | + |
14 | 14 | logger = logging.getLogger("uvicorn.error") |
15 | 15 |
|
16 | 16 |
|
@@ -47,7 +47,8 @@ async def get_beets_statistics(): |
47 | 47 | app.mount("/static", StaticFiles(directory="static"), name="static") |
48 | 48 |
|
49 | 49 | templates = Jinja2Templates(directory="templates") |
50 | | -templates.env.filters['quote_plus'] = lambda u: quote_plus(u) |
| 50 | +templates.env.filters["quote_plus"] = lambda u: quote_plus(u) |
| 51 | + |
51 | 52 |
|
52 | 53 | @app.get("/", response_class=HTMLResponse) |
53 | 54 | async def get_general_stats( |
|
0 commit comments