✅ Add more tests for current behaviour
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / ui / stdin / ListDownloadsCommand.java
index c352cdf..ede0024 100644 (file)
@@ -77,7 +77,7 @@ public class ListDownloadsCommand implements Command {
        @Override
        public State execute(State state, List<String> parameters, Writer outputWriter) throws IOException {
                int counter = 0;
-               List<Download> downloads = newArrayList(from(core.downloads()).toSortedList(Ordering.from(BY_NAME).compound(BY_RUNNING)));
+               List<Download> downloads = newArrayList(from(core.downloads()).toSortedList(Ordering.from(BY_RUNNING).compound(BY_NAME)));
                for (Download download : downloads) {
                        DccReceiver dccReceiver = download.dccReceiver();
                        if (dccReceiver == null) {
@@ -98,7 +98,6 @@ public class ListDownloadsCommand implements Command {
                        outputWriter.write(")\n");
                }
                outputWriter.write("End of DCCs.\n");
-               outputWriter.flush();
                return state.setLastDownloads(downloads);
        }