Commit Graph

63 Commits

Author SHA1 Message Date
pacnpal
df9099f2c8 diabolical 2024-11-18 05:17:37 +00:00
pacnpal
fc06e54d8a fixed imports again 2024-11-18 01:21:40 +00:00
pacnpal
d03e8dc8e8 ch ch ch changes 2024-11-18 01:01:12 +00:00
pacnpal
53f071c338 fix(core): add fallback to absolute imports in __init__.py 2024-11-17 22:22:25 +00:00
pacnpal
bd729c2bfc fix(core): add fallback to absolute imports in settings.py 2024-11-17 22:17:10 +00:00
pacnpal
0afb28d492 fix(core): add fallback to absolute imports in response_handler.py 2024-11-17 22:16:33 +00:00
pacnpal
ddaab828fa fix(core): add fallback to absolute imports in lifecycle.py 2024-11-17 22:14:23 +00:00
pacnpal
ba6eb11e81 fix(core): add fallback to absolute imports in initialization.py 2024-11-17 22:13:51 +00:00
pacnpal
e01d89bd94 fix(core): add fallback to absolute imports in guild.py 2024-11-17 22:13:11 +00:00
pacnpal
7a11a88143 fix(core): add fallback to absolute imports in events.py 2024-11-17 22:12:27 +00:00
pacnpal
fe4353ec96 fix(core): add fallback to absolute imports in error_handler.py 2024-11-17 22:11:48 +00:00
pacnpal
6c7f7fd5ad fix(core): add fallback to absolute imports in commands.py 2024-11-17 22:11:11 +00:00
pacnpal
26f173ce72 fix(core): add fallback to absolute imports in cleanup.py 2024-11-17 22:10:44 +00:00
pacnpal
c0c70f346e fix(core): add fallback to absolute imports in base.py 2024-11-17 22:10:12 +00:00
pacnpal
6cba32c6b3 standardized 2024-11-17 22:09:41 +00:00
pacnpal
d1b5e4156a fix(core): simplify relative import in core/__init__.py 2024-11-17 21:53:23 +00:00
pacnpal
3fed7a7a6c fix(core): add fallback to absolute imports in component_manager 2024-11-17 21:52:53 +00:00
pacnpal
e997c6f6b9 Created a proper dependency hierarchy:
core/types.py - Contains shared interfaces and types
queue/types.py - Contains queue-specific types
Components now depend on interfaces rather than concrete implementations
Broke cyclic dependencies:

Removed direct imports between queue_processor.py and manager.py
Removed circular dependencies between core and processor modules
Components now communicate through well-defined interfaces
Improved architecture:

Clear separation of concerns
Better dependency management
More maintainable and testable code
Proper use of dependency injection
2024-11-17 21:11:00 +00:00
pacnpal
aa61c738a2 fixed more imports 2024-11-17 20:46:22 +00:00
pacnpal
4fc2afc446 fixed some more imports 2024-11-17 20:43:55 +00:00
pacnpal
ad8a4e3dbe import fix 2024-11-17 20:39:12 +00:00
pacnpal
97dd6d72f2 loads of import fixes 2024-11-17 19:47:18 +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
4fe45458bf In the core module:
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
2024-11-17 02:58:53 +00:00
pacnpal
7c898e5aee Fix component_manager.py imports:
- Replace string-based imports with direct imports
- Update CORE_COMPONENTS to use actual classes
- Remove dynamic import logic
- Fix relative imports
2024-11-16 22:49:57 +00:00
pacnpal
dac21f2fcd fixed 2024-11-16 22:32:08 +00:00
pacnpal
b7d99490cf refactor: Clean up imports in settings_commands.py
- 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
2024-11-16 22:13:53 +00:00
pacnpal
febfaaeea5 refactor: Clean up imports in database_commands.py
- 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
2024-11-16 22:10:28 +00:00
pacnpal
6493356670 fix: Improve imports in archiver_commands.py
- 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
2024-11-16 22:00:22 +00:00
pacnpal
b6e397fb95 refactor: Clean up cleanup.py
- Remove duplicate docstring
- Remove unused signal import
- Reorganize imports in a more logical order
- Group standard library imports together
2024-11-16 21:59:13 +00:00
pacnpal
202a909057 fix: Add missing imports in guild.py
- Add pathlib.Path import for download_path usage
- Add Dict, Any, Optional from typing for better type hints
- Organize imports according to best practices
2024-11-16 21:57:26 +00:00
pacnpal
775781b325 Improve command handling with better error handling, type hints, and organization
- Add proper error handling with CommandError
- Add proper error context support
- Add better command organization
- Add proper type hints
- Add proper docstrings
- Add better error recovery
- Add proper error context creation
- Add better response handling
- Add proper validation
- Add better logging
- Add proper response types
- Add better error messages
- Add proper status reporting
- Add new status commands
2024-11-16 21:13:08 +00:00
pacnpal
dd467df5fc Created a new constants.py file to store the REACTIONS dictionary
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
2024-11-16 18:12:35 +00:00
pacnpal
771c32e11b Proper use of hybrid_group for main command groups:
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
2024-11-16 17:37:20 +00:00
pacnpal
82244884db Removed deprecated checks imports from redbot.core.commands
Added proper imports from redbot.core.utils.mod
Updated all permission decorators to use admin_or_permissions
2024-11-16 17:19:20 +00:00
pacnpal
08d5dc56cf Fixed role_manager.py typing issues by adding missing imports (Optional, Any)
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
2024-11-16 17:13:11 +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
871eccd978 video_downloader.py correctly imports and uses secure_delete_file with await
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
2024-11-16 16:35:41 +00:00
pacnpal
a4ca6e8ea6 Core Systems:
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
2024-11-16 05:01:29 +00:00
pacnpal
537a325807 Core Functionality:
base.py: Streamlined to core cog functionality and lifecycle management
initialization.py: Centralized initialization logic
error_handler.py: Unified error handling
response_handler.py: Consistent response handling
Command Organization:

commands/archiver_commands.py: Core archiver functionality
commands/database_commands.py: Database operations
commands/settings_commands.py: Settings management
All commands properly integrated with the cog using setup functions
Improved Architecture:

Consistent command registration pattern
Better separation of concerns
Maintained all original functionality
Enhanced error handling and response management
Proper command integration with the cog structure
2024-11-16 03:30:11 +00:00
pacnpal
6aeb87fb40 Added immediate deferral for all slash commands that perform async operations, preventing the "Unknown interaction" error
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
2024-11-16 03:12:22 +00:00
pacnpal
e1d65ffcd0 massage 2024-11-16 02:11:44 +00:00
pacnpal
b2369d6e61 no 2024-11-16 02:06:33 +00:00
pacnpal
fa494dccd3 fix 2024-11-16 01:57:41 +00:00
pacnpal
18792c77f2 fix 2024-11-16 01:50:34 +00:00
pacnpal
669db54442 Added proper error handling in enable_database command to handle cases where the setting doesn't exist yet
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
2024-11-16 01:43:17 +00:00
pacnpal
372b7de34a Changed the default "enabled" setting in base.py from True to False to match config_manager.py's default.
Fixed the command error handling by properly referencing the commands from redbot.core.commands instead of using the bare 'commands' reference.
2024-11-16 01:33:59 +00:00
pacnpal
609aecdc4e Updated default settings (video archiving enabled by default)
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
2024-11-16 01:22:37 +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