Updated base.py to use absolute imports
Updated cleanup.py to use absolute imports
Updated events.py to use absolute imports
Updated error_handler.py to use absolute imports
Updated guild.py to use absolute imports
Updated initialization.py to use absolute imports
Updated lifecycle.py to use absolute imports
Updated response_handler.py to use absolute imports
Updated settings.py to use absolute imports
In the core/commands module:
Updated archiver_commands.py to use absolute imports
Updated database_commands.py to use absolute imports
Updated settings_commands.py to use absolute imports
Left init.py unchanged as its relative imports are appropriate
In the processor module:
Updated core.py to use absolute imports
Updated processor/init.py to use absolute imports
Updated queue_handler.py to use absolute imports
Updated queue_processor.py to use absolute imports
Updated status_display.py to use absolute imports
Updated cleanup_manager.py to use absolute imports
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
Implemented proper singleton pattern in ProgressTracker class
Created shared instance in utils/init.py
Updated all files to use relative imports correctly
Removed duplicate progress_tracker.py from processor/
Fixed circular imports by removing ProgressTracker from processor.py re-exports
- Force reload of all command modules
- Remove modules from sys.modules before importing
- Reload utils module after importing
- Ensure proper exception imports
- 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
- Add CommandError and EventError to imports and __all__
- Add CogError to imports and __all__
- Add TrackingError to imports and __all__
- Add helper functions for error handling and progress tracking
- Add version information and shared instances
- Add __all__ list to exceptions.py
- Fix absolute imports to use relative imports
- Fix duplicate imports
- Fix truncated code in download_core.py
- Add missing imports and type hints
- Fix indentation and formatting issues
- Remove unused imports (Union, List)
- Add redbot.core.commands import
- Move core.settings import to top of local imports
- Group imports by standard library, discord, and local modules
- Improve import organization for better readability
- Remove unused imports (Tuple, Union)
- Add redbot.core.commands import
- Group imports by standard library, discord, and local modules
- Improve import organization for better readability
- Add missing redbot.core.commands import
- Organize imports into standard library, discord, and local groups
- Fix CommandContext.__aenter__ to use self.ctx instead of global ctx
- Add pathlib.Path import for download_path usage
- Add Dict, Any, Optional from typing for better type hints
- Organize imports according to best practices
Updated all files to import REACTIONS from constants.py instead of reactions.py:
queue_processor.py
message_handler.py
reactions.py (now only contains reaction handling functions)
events.py (now imports REACTIONS from constants.py and handle_archived_reaction from reactions.py)
core.py
queue_handler.py
processor/init.py
archiver: Main bot control commands
settings: Configuration commands
archivedb: Database management commands
Consistent decorator order across all commands:
@group.command() or @hybrid_group()
@guild_only()
@admin_or_permissions() (where needed)
@app_commands.describe() (for parameters)
Proper parameter descriptions using app_commands.describe for better slash command integration
Added process_queue method to EnhancedVideoQueueManager and updated its initialization
Updated component_manager.py to use EnhancedVideoQueueManager correctly
Fixed circular imports in the core module by:
Moving initialization logic to lifecycle.py
Making initialization.py provide thin wrappers that delegate to lifecycle.py
Ensuring proper import order in base.py
Verified all module init.py files are properly exposing their components:
core/init.py exposes VideoArchiver
queue/init.py exposes EnhancedVideoQueueManager and dependencies
processor/init.py exposes VideoProcessor and related components
commands/init.py exposes command setup functions
The import chain is now clean:
base.py imports from lifecycle.py
lifecycle.py contains all initialization logic
initialization.py delegates to lifecycle.py
No circular dependencies
All components are properly exposed through their respective init.py files
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
guild.py correctly imports cleanup_downloads directly from file_ops.py
initialization.py now correctly imports cleanup_downloads from file_ops.py
cleanup.py now correctly imports cleanup_downloads from file_ops.py
utils/init.py correctly re-exports both functions
The circular import has been resolved by:
Having all files import directly from file_ops.py
Removing the re-export of cleanup_downloads from cleanup.py
Ensuring proper async/await usage throughout
Component-based architecture with lifecycle management
Enhanced error handling and recovery mechanisms
Comprehensive state management and tracking
Event-driven architecture with monitoring
Queue Management:
Multiple processing strategies for different scenarios
Advanced state management with recovery
Comprehensive metrics and health monitoring
Sophisticated cleanup system with multiple strategies
Processing Pipeline:
Enhanced message handling with validation
Improved URL extraction and processing
Better queue management and monitoring
Advanced cleanup mechanisms
Overall Benefits:
Better code organization and maintainability
Improved error handling and recovery
Enhanced monitoring and reporting
More robust and reliable system
Improved the interaction response handling system to better manage both deferred and non-deferred responses
Enhanced error handling around interaction responses
Added proper fallback mechanisms for response handling
Fixed redbot import issues by importing specific exception classes
Ensured database setting is properly synchronized between base.py and config_manager.py
Added proper database initialization and reference handling
New database functionality and commands
Additional video format support (MKV)
Message duration now in hours (0-168)
Enhanced error handling and logging
Queue persistence and management improvements
Hardware acceleration updates
More detailed command descriptions
Improved performance & limitations documentation
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
Commands will now work correctly during initialization
Video processing features still wait for full initialization
Properly handle both single string and list prefixes
Only video processing features are blocked until initialization completes
The on_message event handler now checks if a message is a command first and lets it process normally