Skip to content

Commit

Permalink
fix: Removed unnecessary lines of code from GetFilename class in Drif…
Browse files Browse the repository at this point in the history
…ty GUI
  • Loading branch information
SaptarshiSarkar12 committed Oct 31, 2023
1 parent 99c4a57 commit e5035ef
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/main/java/GUI/Forms/GetFilename.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import java.io.*;
import java.nio.charset.Charset;
import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentLinkedDeque;
Expand Down Expand Up @@ -65,26 +64,10 @@ protected ConcurrentLinkedDeque<Job> call() {
if (proceed) {
Timer timer = new Timer();
timer.scheduleAtFixedRate(getJson(), 1000, 150);
LinkedList<String> jsonList = Utility.getLinkMetadata(link);
Utility.getLinkMetadata(link);
timer.cancel();
sleep(500); //give timerTask enough time to do its last run
jobList.clear();
for (String json : jsonList) {
String filename;
String fileLink;
if (isSpotify(link)) {
filename = Utility.extractSpotifyFilename(json);
fileLink = Utility.getSpotifyDownloadLink(link);
String baseName = FilenameUtils.getBaseName(filename);
filename = baseName + ".mp3";
} else {
filename = Utility.getFilenameFromJson(json);
fileLink = link;
String baseName = FilenameUtils.getBaseName(filename);
filename = baseName + ".mp4";
}
jobList.addLast(new Job(fileLink, dir, filename, false));
}
FormsController.setDownloadInfoColor(Colors.GREEN);
updateMessage("File(s) added to batch.");
if (progTimer != null) {
Expand Down

1 comment on commit e5035ef

@vercel
Copy link

@vercel vercel bot commented on e5035ef Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.