From 986dc17013f12015b27e9f50ad641d3bbb199ce9 Mon Sep 17 00:00:00 2001 From: tcely Date: Fri, 21 Feb 2025 04:19:12 -0500 Subject: [PATCH] Use multiple threads for renaming A single thread is much too slow for hundreds, or more, rename tasks. With at least two, one thread can be loading while another is being processed. The times when nothing is happening are reduced significantly. --- tubesync/tubesync/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tubesync/tubesync/settings.py b/tubesync/tubesync/settings.py index 20b53fcc..c9332fcd 100644 --- a/tubesync/tubesync/settings.py +++ b/tubesync/tubesync/settings.py @@ -209,6 +209,9 @@ if MAX_RUN_TIME < 600: DOWNLOAD_MEDIA_DELAY = 60 + (MAX_RUN_TIME / 20) +if RENAME_SOURCES or RENAME_ALL_SOURCES: + BACKGROUND_TASK_ASYNC_THREADS += 1 + if BACKGROUND_TASK_ASYNC_THREADS > MAX_BACKGROUND_TASK_ASYNC_THREADS: BACKGROUND_TASK_ASYNC_THREADS = MAX_BACKGROUND_TASK_ASYNC_THREADS