Merge pull request #108 from InsanusMokrassar/0.9.1

0.9.1
This commit is contained in:
InsanusMokrassar 2021-09-21 15:28:38 +06:00 committed by GitHub
commit d631d63490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 4 deletions

View File

@ -1,5 +1,13 @@
# SauceNaoAPI Changelog
## 0.9.1
* Versions updates:
* `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`, `urls`
## 0.9.0
* Versions updates:

View File

@ -1,10 +1,10 @@
kotlin.code.style=official
kotlin_version=1.5.30
kotlin_coroutines_version=1.5.1
kotlin_version=1.5.31
kotlin_coroutines_version=1.5.2
kotlin_serialisation_version=1.2.2
klock_version=2.4.0
klock_version=2.4.2
ktor_version=1.6.3
gradle_github_release_plugin_version=2.2.12
library_version=0.9.0
library_version=0.9.1

View File

@ -159,3 +159,18 @@ 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()) + (memberName ?.split(", ") ?: emptyList())
val ResultData.charactersList: List<String>
get() = characters ?.split(", ") ?: emptyList()
val ResultData.titles: List<String>
get() = title ?.split(", ") ?: emptyList()
val ResultData.urls: List<String>
get() = extUrls + (url ?.split(", ") ?: emptyList())