🎨 Add Sone.allImages accessor
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / data / Sone.kt
index 3f70ad7..34403a1 100644 (file)
@@ -51,3 +51,11 @@ val postCountComparator: Comparator<Sone> =
 
 val imageCountComparator: Comparator<Sone> =
                comparing<Sone, Int> { it.rootAlbum.allImages.size }.reversed()
+
+val Sone.allAlbums: List<Album>
+       get() =
+               rootAlbum.albums.flatMap(Album::allAlbums)
+
+val Sone.allImages: Collection<Image>
+       get() =
+               rootAlbum.allImages