Compare commits

...

7 Commits
0.9.0 ... 0.9.1

4 changed files with 29 additions and 5 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,6 +1,7 @@
# SauceNaoAPI
[ ![Download](https://api.bintray.com/packages/insanusmokrassar/SauceNaoAPI/saucenaoapi/images/download.svg) ](https://bintray.com/insanusmokrassar/SauceNaoAPI/saucenaoapi/_latestVersion)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/saucenaoapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/saucenaoapi)
It is wrapper for [SauceNAO](https://saucenao.com/) API. For now, library is
in preview state. It can be fully used, but some of info can be unavailable from

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())