This commit is contained in:
pacnpal
2024-11-17 21:33:12 +00:00
parent 439cf5ff07
commit b8f29341ce
4 changed files with 18 additions and 23 deletions

View File

@@ -20,7 +20,7 @@ from typing import (
from datetime import datetime, timedelta from datetime import datetime, timedelta
if TYPE_CHECKING: if TYPE_CHECKING:
from ..processor.queue_handler import QueueHandler from .queue_handler import QueueHandler
from ..ffmpeg.ffmpeg_manager import FFmpegManager from ..ffmpeg.ffmpeg_manager import FFmpegManager
from ..utils.exceptions import CleanupError from ..utils.exceptions import CleanupError

View File

@@ -8,21 +8,16 @@ from typing import Any, ClassVar, Dict, List, Optional, Tuple, TYPE_CHECKING
import discord # type: ignore import discord # type: ignore
from discord.ext import commands # type: ignore from discord.ext import commands # type: ignore
from ..core.types import ( from ..core.types import ComponentState, ProcessorState, ComponentStatus
IComponent, from .constants import REACTIONS
IConfigManager,
IQueueManager,
ProcessorState,
ComponentStatus,
)
from ..processor.constants import REACTIONS
from ..utils import progress_tracker from ..utils import progress_tracker
from ..utils.exceptions import ProcessorError from ..utils.exceptions import ProcessorError
if TYPE_CHECKING: if TYPE_CHECKING:
from ..processor.cleanup_manager import CleanupManager from .cleanup_manager import CleanupManager
from ..processor.message_handler import MessageHandler from .message_handler import MessageHandler
from ..processor.queue_handler import QueueHandler from .queue_handler import QueueHandler
from ..core.types import IComponent, IConfigManager, IQueueManager
logger = logging.getLogger("VideoArchiver") logger = logging.getLogger("VideoArchiver")
@@ -153,9 +148,9 @@ class VideoProcessor(IComponent):
def __init__( def __init__(
self, self,
bot: commands.Bot, bot: commands.Bot,
config_manager: IConfigManager, config_manager: "IConfigManager",
components: Dict[int, Dict[str, Any]], components: Dict[int, Dict[str, Any]],
queue_manager: Optional[IQueueManager] = None, queue_manager: Optional["IQueueManager"] = None,
ffmpeg_mgr: Optional[Any] = None, ffmpeg_mgr: Optional[Any] = None,
db: Optional[Any] = None, db: Optional[Any] = None,
) -> None: ) -> None:
@@ -173,9 +168,9 @@ class VideoProcessor(IComponent):
try: try:
# Import handlers here to avoid circular imports # Import handlers here to avoid circular imports
from ..processor.queue_handler import QueueHandler from .queue_handler import QueueHandler
from ..processor.message_handler import MessageHandler from .message_handler import MessageHandler
from ..processor.cleanup_manager import CleanupManager, CleanupStrategy from .cleanup_manager import CleanupManager, CleanupStrategy
# Initialize handlers # Initialize handlers
self.queue_handler: "QueueHandler" = QueueHandler(bot, config_manager, components) self.queue_handler: "QueueHandler" = QueueHandler(bot, config_manager, components)
@@ -201,7 +196,7 @@ class VideoProcessor(IComponent):
raise ProcessorError(f"Failed to initialize processor: {str(e)}") raise ProcessorError(f"Failed to initialize processor: {str(e)}")
@property @property
def state(self) -> ProcessorState: def state(self) -> ComponentState:
"""Get processor state""" """Get processor state"""
return self._state return self._state
@@ -299,7 +294,7 @@ class VideoProcessor(IComponent):
active_ops = self.operation_tracker.get_active_operations() active_ops = self.operation_tracker.get_active_operations()
# Import StatusDisplay here to avoid circular imports # Import StatusDisplay here to avoid circular imports
from ..processor.status_display import StatusDisplay from .status_display import StatusDisplay
# Create and send status embed # Create and send status embed
embed = await StatusDisplay.create_queue_status_embed( embed = await StatusDisplay.create_queue_status_embed(

View File

@@ -10,9 +10,9 @@ import discord # type: ignore
from discord.ext import commands # type: ignore from discord.ext import commands # type: ignore
from ..config_manager import ConfigManager from ..config_manager import ConfigManager
from ..processor.constants import REACTIONS from .constants import REACTIONS
from ..processor.message_validator import MessageValidator, ValidationError from .message_validator import MessageValidator, ValidationError
from ..processor.url_extractor import URLExtractor, URLMetadata from .url_extractor import URLExtractor, URLMetadata
from ..queue.types import QueuePriority from ..queue.types import QueuePriority
from ..utils.exceptions import MessageHandlerError from ..utils.exceptions import MessageHandlerError

View File

@@ -15,7 +15,7 @@ from ..utils.message_manager import MessageManager
from ..utils.exceptions import QueueHandlerError from ..utils.exceptions import QueueHandlerError
from ..queue.models import QueueItem from ..queue.models import QueueItem
from ..config_manager import ConfigManager from ..config_manager import ConfigManager
from ..processor.constants import REACTIONS from .constants import REACTIONS
logger = logging.getLogger("VideoArchiver") logger = logging.getLogger("VideoArchiver")