From 7c1af177ace1dad9ccbfe741ee3487f165023a03 Mon Sep 17 00:00:00 2001 From: hstr0100 Date: Sun, 20 Oct 2024 23:40:43 -0300 Subject: [PATCH] Fix pause button not working --- .../brlns/gdownloader/YtDlpDownloader.java | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/net/brlns/gdownloader/YtDlpDownloader.java b/core/src/main/java/net/brlns/gdownloader/YtDlpDownloader.java index 7de5d5c..241cf34 100644 --- a/core/src/main/java/net/brlns/gdownloader/YtDlpDownloader.java +++ b/core/src/main/java/net/brlns/gdownloader/YtDlpDownloader.java @@ -236,11 +236,6 @@ public CompletableFuture captureUrl(@Nullable String inputUrl, boolean return future; } - if(capturedLinks.contains(inputUrl)){ - future.complete(false); - return future; - } - String filteredUrl; //TODO: move these to the appropriate classes. if(filter instanceof YoutubePlaylistFilter){ @@ -352,10 +347,7 @@ public CompletableFuture captureUrl(@Nullable String inputUrl, boolean } if(filteredUrl == null){ - if(main.getConfig().isDebugMode()){ - main.handleException(new Throwable("Filtered url was null")); - } - + log.error("Filtered url was null."); future.complete(false); return future; } @@ -420,6 +412,12 @@ public CompletableFuture captureUrl(@Nullable String inputUrl, boolean downloadDeque.offerLast(queueEntry); fireListeners(); + if(main.getConfig().isAutoDownloadStart()){ + if(!downloadsRunning.get() && !downloadDeque.isEmpty()){ + startDownloads(); + } + } + future.complete(true); return future; } @@ -606,12 +604,6 @@ private void queryVideo(QueueEntry queueEntry){ } public void processQueue(){ - if(main.getConfig().isAutoDownloadStart()){ - if(!downloadsRunning.get() && !downloadDeque.isEmpty()){ - startDownloads(); - } - } - while(downloadsRunning.get() && !downloadDeque.isEmpty()){ if(runningDownloads.get() >= main.getConfig().getMaxSimultaneousDownloads()){ break;