by Guest on 2026/04/10 06:28:36 PM
Objective: To improve the responsiveness and accuracy of the "Time Left" (ETA) display when available bandwidth fluctuates (e.g., when one download in a queue completes).
The Problem
Currently, the ETA calculation appears to use a long-term average of the download speed. When a competing download finishes and the remaining download’s speed spikes, the ETA "drifts" down slowly rather than snapping to the new reality. This creates a disconnect between the displayed speed and the projected completion time.
Proposed Solution
Transition the ETA calculation from a global average to a Short-Term Moving Average (SMA) or a Weighted Moving Average.
Window Duration: Calculate the ETA based on the average download speed of the last 10–15 seconds.
Logic: ETA = Remaining Bytes \ Average Speed over last n seconds
Benefits to the User
Instant Feedback: The UI will immediately reflect the "boost" in speed when other tasks finish.
Accuracy: Provides a realistic "live" estimate that accounts for the volatile nature of P2P connections.
UI Polish: Eliminates the "incremental crawl" where the timer counts down slower than actual seconds.