Skip to content

Commit

Permalink
Fix pause button not working
Browse files Browse the repository at this point in the history
  • Loading branch information
hstr0100 committed Oct 21, 2024
1 parent e3a8fe0 commit 7c1af17
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions core/src/main/java/net/brlns/gdownloader/YtDlpDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ public CompletableFuture<Boolean> 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){
Expand Down Expand Up @@ -352,10 +347,7 @@ public CompletableFuture<Boolean> 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;
}
Expand Down Expand Up @@ -420,6 +412,12 @@ public CompletableFuture<Boolean> captureUrl(@Nullable String inputUrl, boolean
downloadDeque.offerLast(queueEntry);
fireListeners();

if(main.getConfig().isAutoDownloadStart()){
if(!downloadsRunning.get() && !downloadDeque.isEmpty()){
startDownloads();
}
}

future.complete(true);
return future;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7c1af17

Please sign in to comment.