add several extensions to ResultData: authors, froms, charactersList, titles

This commit is contained in:
InsanusMokrassar 2021-09-21 14:47:40 +06:00
parent 64109735f8
commit b5ceff32bd
2 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,7 @@
* `Kotlin`: `1.5.30` -> `1.5.31`
* `Klock`: `2.4.0` -> `2.4.2`
* `Coroutines`: `1.5.1` -> `1.5.2`
* Add several extensions to `ResultData`: `authors`, `froms`, `charactersList`, `titles`
## 0.9.0

View File

@ -159,3 +159,15 @@ data class ResultData(
@SerialName("ext_urls")
val extUrls: List<String> = emptyList()
)
val ResultData.froms: List<String>
get() = material ?.split(", ") ?: emptyList()
val ResultData.authors: List<String>
get() = creator ?.split(", ") ?: emptyList()
val ResultData.charactersList: List<String>
get() = characters ?.split(", ") ?: emptyList()
val ResultData.titles: List<String>
get() = title ?.split(", ") ?: emptyList()