Closed ragmehos closed 1 month ago
The changes made in the streaming_providers/torbox/utils.py
file focus on enhancing the update_torbox_cache_status
function and introducing a new utility function. The import statements have been updated, and a new function called divide_chunks
has been added to process streams in manageable batches of 80. This adjustment addresses the limitations of the Torbox API. Additionally, error handling has been improved by incorporating logging for better visibility of exceptions during the cache status update process.
File | Change Summary |
---|---|
streaming_providers/torbox/utils.py | - Modified import statements, added logging , removed PTT import. |
- Added new function divide_chunks(lst, n) to yield n-sized chunks from a list. |
|
- Altered update_torbox_cache_status to process streams in chunks of 80 and enhanced error logging. |
sequenceDiagram
participant User
participant Torbox
participant Logger
User->>Torbox: Request cache status update
Torbox->>Torbox: Divide streams into chunks
Torbox->>Torbox: Process each chunk
alt If error occurs
Torbox->>Logger: Log error message
end
Torbox-->>User: Return updated cache status
🐰 In the land of code where rabbits play,
New functions hop in, brightening the day.
Chunks of streams, we now divide,
With logs to catch errors, we take great pride!
So let’s celebrate this code delight,
For every small change makes our future bright! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes