Skip to content

Conversation

@auouymous
Copy link
Member

update_downloads_list() can take several seconds when thousands of episodes are downloading. Its timer is now adjusted from 1.5 to 5 seconds based on how long the function took to run. This will increase the time between UI lockups when downloading. The timer is also disabled when performing actions that show a progress indicator, which allows the actions to finish significantly faster.

The download queue manager can also be disabled when performing actions to further decrease the time they take.

A progress indicator is now shown when cancelling tasks, pausing downloads, resuming paused downloads, or when retrying failed downloads. These actions now finish much faster due to the above improvements.

The new progress indicator requires less code at callsites and can show a message on the final tick if the action performs a final long running operation, such as calling update_downloads_list().

Shift-selections now only update at 250ms intervals to improve responsiveness while mass selecting episodes.

A new idle_timeout_add() function has been added to allow for timeouts that are handled at the same priority as idle_add(). This should eliminate all issues related to #1311.

Add on_ticks() and max_ticks to simplify code using progress indicators.
And support final ticks to set progress to 100% before a final long
operation.

Change interval from 100ms to 250ms, to allow more time to be spent on
the operation.
Changing task state causes UI to hang while DownloadQueueManager spawns
threads and updates progress tab. And the update_downloads_list() timer
can hang UI for several seconds at a time when thousands of tasks are
queued.

Disabling both of these while a progress dialog is open allows tasks to
be queued faster and the dialog closed sooner.
Add util.idle_timeout_add() to register timers with the same priority as
idle_add(). Change the IdleTimeout to also use the idle_add() priority.
This eliminates the chance of a timer blocking any idle_add from
running.

Change most timeout_add's to idle_timeout_add. Change the timer in
DownloadStatusModel::get_next() back to an idle_add.
A fast key repeat rate can cause on_episode_list_selection_changed to be
called quicker than it can update the UI. This slows down
shift-selections and results in continued processing long after the key
has been released.

The 250ms timer batches multiple events into a single update, and
improves responsiveness on slower machines.
upload_downloads_list() is now called at upto 5 second intervals when
there are a lot of tasks. Previously, it could take 5 seconds to run and
then only sleep for 1.5 seconds, making the UI unresponsive for long
periods.
The indicator was previously shown only while queueing new tasks, but
not when queueing failed tasks or unpausing paused tasks. It is now
displayed while scanning the episodes and then restarts when queueing
new tasks.

The download update timer and download queue manager are also disabled
earlier to significantly speed up the process.
This also significantly speeds up pausing by disabling download update
timer and download queue manager.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant