Only store the failed downloads.
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / ui / stdin / RestartCommand.java
index 84a7d2e..bd8fac8 100644 (file)
@@ -30,16 +30,16 @@ import net.pterodactylus.xdcc.data.Download;
 import com.google.common.primitives.Ints;
 
 /**
- * TODO
+ * Command that can restart a failed download by rerequesting the same pack from the same bot.
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
 public class RestartCommand implements Command {
 
        private final Core core;
-       private final DownloadFailures downloadFailures;
+       private final Collection<Download> downloadFailures;
 
-       public RestartCommand(Core core, DownloadFailures downloadFailures) {
+       public RestartCommand(Core core, Collection<Download> downloadFailures) {
                this.core = core;
                this.downloadFailures = downloadFailures;
        }
@@ -61,7 +61,7 @@ public class RestartCommand implements Command {
                if ((index != null) && (index < lastFailedDownloads.size())) {
                        Download failedDownload = lastFailedDownloads.get(index);
                        core.fetch(failedDownload.bot(), failedDownload.pack());
-                       downloadFailures.removeFailedDownload(failedDownload);
+                       downloadFailures.remove(failedDownload);
                }
                return state;
        }