projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🔥 Remove another function from Sone interface
[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
f1c7d3b
..
081a2fa
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/data/Albums.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/data/Albums.kt
@@
-1,5
+1,5
@@
/**
/**
- * Sone - Albums.kt - Copyright © 2019 David ‘Bombe’ Roden
+ * Sone - Albums.kt - Copyright © 2019
–2020
David ‘Bombe’ Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-21,3
+21,11
@@
package net.pterodactylus.sone.data
val Album.allImages: Collection<Image>
get() =
images + albums.flatMap { it.allImages }
val Album.allImages: Collection<Image>
get() =
images + albums.flatMap { it.allImages }
+
+/**
+ * Returns this album and all albums contained in this album (recursively).
+ * A child album is always listed after its parent.
+ */
+val Album.allAlbums: List<Album>
+ get() =
+ listOf(this) + albums.flatMap(Album::allAlbums)