Commit Graph

28 Commits

Author SHA1 Message Date
pacnpal
97dd6d72f2 loads of import fixes 2024-11-17 19:47:18 +00:00
pacnpal
b1e3f0c9d6 fixed imports hopefully 2024-11-17 16:22:22 +00:00
pacnpal
3d4d385559 fixed imports hopefully 2024-11-17 16:21:17 +00:00
pacnpal
074b462a1b Updated videoarchiver/__init__.py to include all relevant classes from subdirectories 2024-11-17 16:15:27 +00:00
pacnpal
0db1f31f8f Updated videoarchiver/__init__.py to use relative imports for Red-DiscordBot best practices 2024-11-17 16:11:42 +00:00
pacnpal
29606683d4 Updated videoarchiver/__init__.py to include all imports from cog subdirectories 2024-11-17 16:10:20 +00:00
pacnpal
62c97f0b01 Converted all 'from videoarchiver.' imports to relative imports 2024-11-17 16:05:12 +00:00
pacnpal
c830be2841 videoarchiver/config/validation_manager.py
videoarchiver/config/role_manager.py
videoarchiver/database/connection_manager.py
videoarchiver/database/schema_manager.py
videoarchiver/queue/cleaners/tracking_cleaner.py
videoarchiver/exceptions.py
videoarchiver/processor.py
videoarchiver/commands.py
videoarchiver/update_checker.py
videoarchiver/utils/path_manager.py
videoarchiver/utils/file_ops.py
videoarchiver/processor/message_validator.py
videoarchiver/utils/download_manager.py
2024-11-17 06:12:41 +00:00
pacnpal
a5c3101d78 1 2024-11-17 03:12:47 +00:00
pacnpal
247381fc8a Changing the relative import in core.py to use an absolute import path:
from videoarchiver.utils import progress_tracker
Updated the main init.py to properly handle module reloading:
Added 'videoarchiver.processor' and 'videoarchiver.processor.core' to modules_to_reload
Added explicit import and reload of the processor module
These changes ensure that:

The progress_tracker is properly imported from the utils package
All necessary modules are reloaded during initialization
Circular imports are avoided
The package structure maintains proper dependency flow
2024-11-17 01:29:00 +00:00
pacnpal
dfc2e8dad5 Update root __init__.py:
- Force reload of all command modules
- Remove modules from sys.modules before importing
- Reload utils module after importing
- Ensure proper exception imports
2024-11-17 00:13:29 +00:00
pacnpal
824b8870e1 Update root __init__.py:
- Add module reloading to ensure exceptions are available
- Import and re-export all necessary exceptions
- Maintain existing setup and teardown functions
- Add version information
- Update __all__ list with all exports
2024-11-17 00:07:43 +00:00
pacnpal
e680002731 All module components are now properly initialized and imported:
Database components with proper schema management
FFmpeg components with process management
Queue system with state management
Processor components with proper handlers
Utility components with shared instances
Configuration components with validation
Initialization sequence is now properly ordered:

Config Manager initialization
Path setup
Database initialization
FFmpeg setup
Queue Manager initialization
Video Processor setup
Guild Components initialization
Update Checker startup
Queue Processing start
Proper cleanup handling is in place:

Component cleanup in reverse order
Resource cleanup with timeouts
Force cleanup for hung processes
System-wide FFmpeg process cleanup
Health monitoring is implemented for all components:

Database connection monitoring
Queue health checks
Processor status tracking
Component state validation
2024-11-16 16:43:02 +00:00
pacnpal
01a9067368 Added proper command validation in the on_message event handler to prevent interference with command processing
Added missing asyncio import in events.py
Ensured all long-running operations are handled in background tasks
Fixed task initialization and management in base.py
2024-11-16 01:04:08 +00:00
pacnpal
39061cbf3e Added proper initialization control:
Setup lock in init.py to prevent concurrent cog loads
Check for existing cog instance to prevent duplicates
Setup_in_progress flag to track initialization state
Improved timeout handling and cleanup
Enhanced Queue Manager singleton pattern:
Class-level lock to prevent multiple instance creation
Consistent event naming with _init_event
Sequential component initialization
Proper lock ordering (global -> queue -> processing)
Improved state management:
Single source of truth for initialization state
Proper cleanup of resources on failure
Better error handling and logging
Timeout handling for all async operations
2024-11-15 23:09:55 +00:00
pacnpal
97e0d9c279 re-structure 2024-11-15 22:17:30 +00:00
pacnpal
484b0c0cb8 fix: Add robust error handling for cog loading - Add initialization timeout - Add proper cleanup on failure - Add teardown function - Add proper logging - Add proper cog removal order 2024-11-15 01:04:25 +00:00
pacnpal
888ed27d17 fix: Improve cog loading order - Load main cog first - Wait for initialization - Load commands after successful init 2024-11-15 01:03:53 +00:00
pacnpal
533afd61ed fix: Simplify cog initialization - Let Red handle command syncing - Remove manual sync operations - Clean up __init__.py files 2024-11-15 00:59:00 +00:00
pacnpal
770e74d63c fix: Improve command registration and cleanup - Add proper command syncing - Add teardown function - Add error handling for sync operations 2024-11-15 00:57:24 +00:00
pacnpal
4e632276c2 fix: Resolve command registration issues - Separate command handling into VideoArchiverCommands - Update command registration in __init__.py - Remove duplicate command registration 2024-11-15 00:50:55 +00:00
pacnpal
ba71081687 fix: Properly implement slash commands - Use app_commands for slash command support - Add proper command group structure - Handle command registration and syncing 2024-11-15 00:45:13 +00:00
pacnpal
f3d28231e8 fix imports 2024-11-14 23:45:36 +00:00
pacnpal
171453ce57 fix imports 2024-11-14 23:09:28 +00:00
pacnpal
a0b3a56d4f fix: Update cog initialization
- Added proper Red-DiscordBot cog setup
- Added end user data statement
- Improved module organization
2024-11-14 22:37:59 +00:00
pacnpal
2a50395bd7 fix: Add package __init__.py and fix imports
- Added videoarchiver/__init__.py to make it a proper package
- Fixed import statement in ffmpeg_manager.py to use local imports
2024-11-14 22:29:42 +00:00
pacnpal
73f142addd fixed issues 2024-11-14 21:36:58 +00:00
pacnpal
e2fb53c73a Add error handling to cog setup
- Add proper error logging during cog initialization
- Add CogLoadError handling
- Add logging configuration
2024-11-14 20:05:44 +00:00