chore: make sure that there is only one app

This commit is contained in:
2025-11-02 15:14:34 +01:00
parent e414a1a358
commit ec987eff80
8 changed files with 11 additions and 967 deletions

View File

@@ -5,13 +5,14 @@ from functools import lru_cache
from typing import List, Optional
import structlog
from fastapi import Depends
from src.core.SeriesApp import SeriesApp
from src.server.services.progress_service import (
ProgressService,
ProgressType,
get_progress_service,
)
from src.server.utils.dependencies import get_series_app
logger = structlog.get_logger(__name__)
@@ -38,7 +39,7 @@ class AnimeService:
self._progress_service = progress_service or get_progress_service()
# Initialize SeriesApp with async methods
try:
self._app = SeriesApp(directory)
self._app = Depends(get_series_app)
# Subscribe to SeriesApp events
self._app.download_status += self._on_download_status
self._app.scan_status += self._on_scan_status