X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.kt;h=34403a16c46231e5026ed12556ad97adf9878caf;hb=f049280a40ddf05f02400e7f0d93a24dea4545c2;hp=c44d6e8b81f9b5009ec42e0f88cacf683504113e;hpb=9b0b5b760adf41d52603a4b65f3e5f3220da28eb;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/data/Sone.kt b/src/main/kotlin/net/pterodactylus/sone/data/Sone.kt index c44d6e8..34403a1 100644 --- a/src/main/kotlin/net/pterodactylus/sone/data/Sone.kt +++ b/src/main/kotlin/net/pterodactylus/sone/data/Sone.kt @@ -48,3 +48,14 @@ val postCountComparator: Comparator = comparing { it.posts.size } .thenComparing { it.replies.size } .reversed() + +val imageCountComparator: Comparator = + comparing { it.rootAlbum.allImages.size }.reversed() + +val Sone.allAlbums: List + get() = + rootAlbum.albums.flatMap(Album::allAlbums) + +val Sone.allImages: Collection + get() = + rootAlbum.allImages