mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
Adding the 'db' parameter to the VideoProcessor class initialization
Properly storing and handling the db instance Ensuring the db is passed to the queue_handler when available The QueueHandler class was already properly set up to handle the db parameter, so no changes were needed there. The database integration should now work correctly for: Checking if videos are already archived Adding newly archived videos to the database Providing archived video information to users
This commit is contained in:
@@ -23,18 +23,24 @@ class VideoProcessor:
|
|||||||
config_manager,
|
config_manager,
|
||||||
components,
|
components,
|
||||||
queue_manager=None,
|
queue_manager=None,
|
||||||
ffmpeg_mgr=None
|
ffmpeg_mgr=None,
|
||||||
|
db=None
|
||||||
):
|
):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.config = config_manager
|
self.config = config_manager
|
||||||
self.components = components
|
self.components = components
|
||||||
self.ffmpeg_mgr = ffmpeg_mgr
|
self.ffmpeg_mgr = ffmpeg_mgr
|
||||||
|
self.db = db
|
||||||
|
|
||||||
# Initialize handlers
|
# Initialize handlers
|
||||||
self.queue_handler = QueueHandler(bot, config_manager, components)
|
self.queue_handler = QueueHandler(bot, config_manager, components)
|
||||||
self.message_handler = MessageHandler(bot, config_manager, queue_manager)
|
self.message_handler = MessageHandler(bot, config_manager, queue_manager)
|
||||||
self.progress_tracker = ProgressTracker()
|
self.progress_tracker = ProgressTracker()
|
||||||
|
|
||||||
|
# Pass db to queue handler if it exists
|
||||||
|
if self.db:
|
||||||
|
self.queue_handler.db = self.db
|
||||||
|
|
||||||
# Start queue processing
|
# Start queue processing
|
||||||
logger.info("Starting video processing queue...")
|
logger.info("Starting video processing queue...")
|
||||||
self._queue_task = None
|
self._queue_task = None
|
||||||
|
|||||||
Reference in New Issue
Block a user