🔥 Remove FLATTENER from Album interface
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / data / Sone.kt
index c44d6e8..46ff336 100644 (file)
@@ -48,3 +48,10 @@ val postCountComparator: Comparator<Sone> =
                comparing<Sone, Int> { it.posts.size }
                                .thenComparing<Int> { it.replies.size }
                                .reversed()
+
+val imageCountComparator: Comparator<Sone> =
+               comparing<Sone, Int> { it.rootAlbum.allImages.size }.reversed()
+
+val Sone.allAlbums: List<Album>
+       get() =
+               rootAlbum.albums.flatMap(Album::allAlbums)