refactor: Move imports to avoid circular dependencies in socket and VLCPlayerService
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user