projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🔥 Replace NOT_EMPTY with Kotlin version
[Sone.git]
/
src
/
main
/
kotlin
/
net
/
pterodactylus
/
sone
/
data
/
Albums.kt
diff --git
a/src/main/kotlin/net/pterodactylus/sone/data/Albums.kt
b/src/main/kotlin/net/pterodactylus/sone/data/Albums.kt
index
081a2fa
..
da71d62
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/data/Albums.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/data/Albums.kt
@@
-29,3
+29,10
@@
val Album.allImages: Collection<Image>
val Album.allAlbums: List<Album>
get() =
listOf(this) + albums.flatMap(Album::allAlbums)
val Album.allAlbums: List<Album>
get() =
listOf(this) + albums.flatMap(Album::allAlbums)
+
+@get:JvmName("notEmpty")
+val notEmpty: (Album) -> Boolean = { album ->
+ album.allImages.let { images ->
+ images.isNotEmpty() && images.any(Image::isInserted)
+ }
+}