import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@Subscribe
public void downloadFinished(DownloadFinished downloadFinished) {
Download download = downloadFinished.download();
+ removeFailedDownloads(download.pack().name());
try {
writeLine(green(String.format("Download of %s (from %s, %s) has finished, at %s/s.", download.pack().name(), download.bot().name(), download.bot().network().name(), f(download.dccReceiver().overallRate()))));
} catch (IOException ioe1) {
}
}
+ private void removeFailedDownloads(String name) {
+ List<Download> failedDownloadsToRemove = new ArrayList<>();
+ for (Download failedDownload : failedDownloads) {
+ if (failedDownload.pack().name().equals(name)) {
+ failedDownloadsToRemove.add(failedDownload);
+ }
+ }
+ failedDownloads.removeAll(failedDownloadsToRemove);
+ }
+
/**
* Called when a download fails.
*