refactor: Move imports to avoid circular dependencies in socket and VLCPlayerService
Some checks failed
Backend CI / lint (push) Successful in 9m24s
Backend CI / test (push) Failing after 3m55s

This commit is contained in:
JSC
2025-08-19 22:32:19 +02:00
parent b808cfaddf
commit 9653062003
2 changed files with 7 additions and 4 deletions

View File

@@ -6,7 +6,6 @@ from collections.abc import Callable
from pathlib import Path
from typing import Any
from fastapi import HTTPException, status
from sqlmodel.ext.asyncio.session import AsyncSession
from app.core.logging import get_logger
@@ -15,7 +14,6 @@ from app.models.sound import Sound
from app.models.sound_played import SoundPlayed
from app.repositories.sound import SoundRepository
from app.repositories.user import UserRepository
from app.services.credit import CreditService, InsufficientCreditsError
from app.services.socket import socket_manager
from app.utils.audio import get_sound_file_path
@@ -332,6 +330,9 @@ class VLCPlayerService:
insufficient credits, VLC failure)
"""
from fastapi import HTTPException, status # noqa: PLC0415, I001
from app.services.credit import CreditService, InsufficientCreditsError # noqa: PLC0415
if not self.db_session_factory:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,