Updated default_guild_settings in core/base.py from 25MB to 8MB

Verified consistency with config_manager.py which already had 8MB as default
Confirmed proper validation in config_manager.py (allows 1-100MB range)
Verified all other files reference the max_file_size setting correctly
This commit is contained in:
pacnpal
2024-11-15 20:11:43 +00:00
parent 42b3ceb314
commit 121e1395f4
4 changed files with 94 additions and 46 deletions

View File

@@ -8,7 +8,7 @@ Welcome to **Pac-cogs**, a collection of custom cogs for [Red](https://github.co
|------------|--------------------------------------------------|
| **Birthday** | Assigns a special birthday role to users and sends a celebratory message with random cake or pie emojis. Features include: automatic role removal at midnight in configurable timezone, custom announcement channels, role-based command permissions, random cake/pie emoji generation, task persistence across bot restarts, context menu support (right-click user to assign role), birthday role removal task checking, and no hierarchy requirements for role assignment. Perfect for automated birthday celebrations! |
| **Overseerr** | Allows interaction with [Overseerr](https://overseerr.dev/) directly from Discord. Users can search for movies or TV shows, request them, and have admins approve requests. Features include: media availability checking, request status tracking, admin role configuration, direct integration with Overseerr's API, and full slash command support. Requires a running Overseerr instance and API key. |
| **VideoArchiver** | A powerful video archiving cog that automatically downloads and reposts videos from monitored channels. Features hardware-accelerated compression (NVIDIA, AMD, Intel, ARM), multi-video processing, modular queue system with priority processing and state persistence, role-based permissions, automatic file cleanup, and support for multiple video platforms via yt-dlp. The enhanced queue system provides metrics tracking, health monitoring, and efficient resource management while maintaining quality. |
| **VideoArchiver** | A powerful video archiving cog that automatically downloads and reposts videos from monitored channels. Features hardware-accelerated compression (NVIDIA, AMD, Intel, ARM), multi-video processing, modular queue system with priority processing and state persistence, role-based permissions, automatic file cleanup, and support for multiple video platforms via yt-dlp. The enhanced queue system provides metrics tracking, health monitoring, and efficient resource management while maintaining quality. New features include: video archive database for tracking and retrieving archived videos, detailed queue monitoring with real-time progress tracking, and comprehensive error handling with automatic recovery. |
## Installation

View File

@@ -46,11 +46,11 @@ Before using the cog, you need to set it up. You can use either prefix commands
2. Add roles that can use the birthday command:
```
[p]addrole @Moderator
[p]birthdayallowrole @Moderator
```
or
```
/addrole @Moderator
/birthdayallowrole @Moderator
```
3. (Optional) Set the timezone for role expiration:
@@ -77,9 +77,9 @@ Before using the cog, you need to set it up. You can use either prefix commands
## Usage
To assign the birthday role to a user, you can use any of these methods:
To assign or remove the birthday role from a user, you can use any of these methods:
1. Command:
1. Commands:
```
[p]birthday @User
```
@@ -88,10 +88,20 @@ To assign the birthday role to a user, you can use any of these methods:
/birthday @User
```
2. Context Menu:
Right-click on a user and select "Apps > Give Birthday Role"
To remove:
```
[p]removebirthday @User
```
or
```
/removebirthday @User
```
This will assign the birthday role to the user and send a celebratory message with random cake (or pie) emojis. The role will be automatically removed at midnight in the specified timezone.
2. Context Menu:
- Right-click on a user and select "Apps > Give Birthday Role" to assign
- Right-click on a user and select "Apps > Remove Birthday Role" to remove
When assigning the role, this will give the user the birthday role and send a celebratory message with random cake (or pie) emojis. The role will be automatically removed at midnight in the specified timezone.
## Features
@@ -105,6 +115,7 @@ This will assign the birthday role to the user and send a celebratory message wi
- Full slash command and context menu support
- Persistent birthday role removal scheduling (survives bot restarts)
- Birthday role removal task checking
- Manual birthday role removal option
## Commands
@@ -112,14 +123,16 @@ All commands support both prefix and slash command syntax:
### Admin Commands
- `[p]setrole` or `/setrole`: Set the birthday role
- `[p]addrole` or `/addrole`: Add a role that can use the birthday command
- `[p]removerole` or `/removerole`: Remove a role from using the birthday command
- `[p]birthdayallowrole` or `/birthdayallowrole`: Add a role that can use the birthday command
- `[p]birthdayremoverole` or `/birthdayremoverole`: Remove a role from using the birthday command
- `[p]settimezone` or `/settimezone`: Set the timezone for the birthday role expiration
- `[p]setchannel` or `/setchannel`: Set the channel for birthday announcements
### User Commands
- `[p]birthday` or `/birthday`: Assign the birthday role to a user
- `[p]removebirthday` or `/removebirthday`: Remove the birthday role from a user
- Context Menu > "Give Birthday Role": Right-click a user to assign the birthday role
- Context Menu > "Remove Birthday Role": Right-click a user to remove the birthday role
- `[p]bdaycheck` or `/bdaycheck`: Check upcoming birthday role removal tasks
## Support

View File

@@ -10,28 +10,48 @@ A powerful video archiving cog that automatically downloads and reposts videos f
- Hardware-accelerated compression (NVIDIA, AMD, Intel, ARM)
- Configurable video quality and format
- Automatic file size optimization for Discord limits
- Default maximum file size: 8MB
- Default video format: MP4
- Default video quality: High
- **Video Archive Database**
- Track and store archived video information
- Query archived videos by original URL
- Get Discord links for previously archived videos
- Optional database functionality (disabled by default)
- Automatic database management and cleanup
- Persistent video history tracking
- **Modular Queue System**
- Priority-based processing with state persistence
- Efficient resource management and monitoring
- Real-time performance metrics and health checks
- Automatic cleanup and memory optimization
- Component-based architecture:
- Queue state persistence and recovery
- Health monitoring and metrics tracking
- Resource cleanup and maintenance
- Core queue operations management
- Default concurrent downloads: 2 (configurable 1-5)
- Maximum queue size: 1000 items
- Automatic retry on failures (3 attempts)
- Queue state persistence across bot restarts
- **Progress Tracking**
- Real-time download progress monitoring
- Compression progress tracking
- Hardware acceleration statistics
- Detailed error tracking and analysis
- Memory usage monitoring
- Success rate calculations
- Automatic cleanup of temporary files
- **Channel Management**
- Flexible channel monitoring (specific channels or all)
- Separate archive, notification, and log channels
- Customizable message templates
- Configurable message duration
- Configurable message duration (default: 30 seconds)
- **Access Control**
- Role-based permissions
- Site-specific enabling/disabling
- Admin-only configuration commands
- Per-guild settings
## Installation
@@ -62,6 +82,19 @@ All commands support both prefix and slash command syntax:
- **`va_update`**: Update yt-dlp to latest version
- **`va_toggleupdates`**: Toggle update notifications
### Archiver Management Commands (archiver_)
- **`archiver enable`**: Enable video archiving in the server
- **`archiver disable`**: Disable video archiving in the server
- **`archiver setchannel <channel>`**: Set the archive channel
- **`archiver setlog <channel>`**: Set the log channel
- **`archiver addchannel <channel>`**: Add a channel to monitor
- **`archiver removechannel <channel>`**: Remove a channel from monitoring
### Database Management Commands (archivedb_)
- **`archivedb enable`**: Enable the video archive database
- **`archivedb disable`**: Disable the video archive database
- **`checkarchived <url>`**: Check if a video URL has been archived
### Queue Management Commands (vaq_)
- **`vaq_status`**: Show current queue status with basic metrics
- **`vaq_metrics`**: Show detailed queue performance metrics
@@ -83,32 +116,24 @@ All commands support both prefix and slash command syntax:
- **`vas_enable [sites...]`**: Enable specific sites (empty for all)
- **`vas_list`**: List available and enabled sites
## Queue System Architecture
## Default Settings
The queue system is built with a modular, component-based architecture:
### Core Components
- **Models**: Data structures for queue items and metrics
- **Persistence**: Queue state persistence and recovery
- **Monitoring**: Health checks and performance metrics
- **Cleanup**: Resource management and maintenance
- **Manager**: Core queue operations and coordination
### Metrics and Monitoring
- Real-time queue status and health monitoring
- Comprehensive performance metrics:
- Processing counts and success rates
- Hardware acceleration statistics
- Memory usage tracking
- Error distribution analysis
- Automatic recovery from failures
- Resource usage optimization
### State Management
- Persistent queue state across bot restarts
- Efficient memory management
- Automatic cleanup of old entries
- Priority-based processing
```python
{
"enabled": False, # Video archiving disabled by default
"archive_channel": None, # Must be set before use
"log_channel": None, # Optional error logging channel
"enabled_channels": [], # Channels to monitor
"video_format": "mp4", # Default video format
"video_quality": "high", # Default video quality
"max_file_size": 8, # Maximum file size in MB
"message_duration": 30, # Message duration in seconds
"message_template": "{author} archived a video from {channel}",
"concurrent_downloads": 2, # Number of concurrent downloads
"enabled_sites": None, # None means all sites enabled
"use_database": False # Database tracking disabled by default
}
```
## Message Templates
@@ -116,25 +141,32 @@ You can customize archive messages using these variables:
- `{author}`: Original message author
- `{url}`: Original video URL
- `{original_message}`: Link to original message
- `{channel}`: Original channel name
Example template:
```
📥 Video archived from {author}
Original: {url}
Source: {original_message}
Channel: {channel}
```
## Site Support
The cog supports all sites compatible with yt-dlp. Use `vas_list` to see available sites and currently enabled ones.
## Performance
## Performance & Limitations
- Hardware acceleration automatically detected and utilized
- Configurable concurrent downloads (1-5)
- Automatic file size optimization
- Memory-efficient queue management
- Automatic cleanup of temporary files
- Maximum queue size: 1000 items
- Maximum file size: 8MB by default (configurable up to Discord's limit)
- Maximum video quality: 4320p (8K)
- Automatic retry on failures (3 attempts with 5-second delay)
- Queue cleanup interval: 30 minutes
- Maximum history age: 24 hours
- Unload timeout: 30 seconds
- Cleanup timeout: 15 seconds
## Error Handling
@@ -143,6 +175,9 @@ The cog supports all sites compatible with yt-dlp. Use `vas_list` to see availab
- Automatic retry mechanism
- Queue persistence across restarts
- Detailed error messages
- Error type tracking and analysis
- Automatic recovery procedures
- Force cleanup on timeout
## Support

View File

@@ -41,7 +41,7 @@ class VideoArchiver(commands.Cog):
"enabled_channels": [],
"video_format": "mp4",
"video_quality": "high",
"max_file_size": 25, # MB
"max_file_size": 8, # MB
"message_duration": 30, # seconds
"message_template": "{author} archived a video from {channel}",
"concurrent_downloads": 2,