-
Notifications
You must be signed in to change notification settings - Fork 155
Add ETA calculation for torrents. #916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||
08bcf2f to
68cbf18
Compare
68cbf18 to
6cef70b
Compare
User description
Also remove try catch around progress calculations, and instead change calculation to guarantee safety of values/operations.
PR Type
Enhancement
Description
Add ETA calculation for torrents based on progress and elapsed time
Replace try-catch with safe Math.Clamp for progress calculations
Improve null-safety checks using pattern matching
Calculate remaining time using combined RD and download progress
Diagram Walkthrough
File Walkthrough
QBittorrent.cs
Add ETA calculation and improve progress safetyserver/RdtClient.Service/Services/QBittorrent.cs
Math.Clamp for safe value clamping
combined RD and download progress
torrent.Downloads is { Count: > 0 })Etafield from hardcoded 0 to calculated(Int64)remaining.TotalSecondsstay within valid ranges