chore: make sure that there is only one app
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user