🎨 Rename “newest first” post comparator
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneInserter.java
index e74c98d..ffbed4d 100644 (file)
@@ -22,6 +22,7 @@ import static java.lang.System.currentTimeMillis;
 import static java.util.concurrent.TimeUnit.*;
 import static java.util.logging.Logger.getLogger;
 import static java.util.stream.Collectors.toList;
+import static net.pterodactylus.sone.data.PostKt.newestPostFirst;
 
 import java.io.*;
 import java.nio.charset.Charset;
@@ -40,7 +41,7 @@ import net.pterodactylus.sone.core.event.InsertionDelayChangedEvent;
 import net.pterodactylus.sone.core.event.SoneInsertAbortedEvent;
 import net.pterodactylus.sone.core.event.SoneInsertedEvent;
 import net.pterodactylus.sone.core.event.SoneInsertingEvent;
-import net.pterodactylus.sone.data.AlbumsKt;
+import net.pterodactylus.sone.data.AlbumKt;
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.data.Reply;
 import net.pterodactylus.sone.data.Sone;
@@ -308,11 +309,11 @@ public class SoneInserter extends AbstractService {
                        soneProperties.put("name", sone.getName());
                        soneProperties.put("time", currentTimeMillis());
                        soneProperties.put("profile", sone.getProfile());
-                       soneProperties.put("posts", Ordering.from(Post.NEWEST_FIRST).sortedCopy(sone.getPosts()));
+                       soneProperties.put("posts", Ordering.from(newestPostFirst()).sortedCopy(sone.getPosts()));
                        soneProperties.put("replies", Ordering.from(Reply.TIME_COMPARATOR).reverse().sortedCopy(sone.getReplies()));
                        soneProperties.put("likedPostIds", new HashSet<>(sone.getLikedPostIds()));
                        soneProperties.put("likedReplyIds", new HashSet<>(sone.getLikedReplyIds()));
-                       soneProperties.put("albums", SoneKt.getAllAlbums(sone).stream().filter(AlbumsKt.notEmpty()::invoke).collect(toList()));
+                       soneProperties.put("albums", SoneKt.getAllAlbums(sone).stream().filter(AlbumKt.notEmpty()::invoke).collect(toList()));
                        manifestCreator = new ManifestCreator(core, soneProperties);
                }