Добавлено описание проекта PVideoDl, включая функциональность, стек технологий, архитектуру, инструкции по запуску и API. Обновлён README.md для лучшего понимания проекта.

This commit is contained in:
Leonid Pershin
2026-06-19 12:07:55 +03:00
parent e15d0af056
commit 3281fa2a5d
43 changed files with 4699 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
"""Доступ к разделяемым компонентам приложения через app.state.
Компоненты (Storage, DownloadQueue, EventBus, WorkerPool) создаются в lifespan
в main.py и кладутся в app.state. Роуты достают их отсюда через Depends.
"""
from __future__ import annotations
from fastapi import Request
from app.core.events import EventBus
from app.core.queue import DownloadQueue
from app.core.storage import Storage
def get_storage(request: Request) -> Storage:
return request.app.state.storage
def get_queue(request: Request) -> DownloadQueue:
return request.app.state.queue
def get_events(request: Request) -> EventBus:
return request.app.state.events