Compare commits

..

31 Commits

Author SHA1 Message Date
d0c143dcd6 update dependencies 2022-03-16 12:50:57 +06:00
3ee0d0de7d start 0.10.1 2022-03-16 12:49:32 +06:00
d04ee03043 Merge pull request #116 from InsanusMokrassar/0.10.0
0.10.0
2022-03-11 13:59:37 +06:00
e173bd71e0 migration onto toml and actualizing of publish scripts 2022-03-11 13:54:01 +06:00
11aac1b581 Update build_and_publish.yml 2022-03-10 01:21:59 +06:00
4319c41e44 Update gradle-wrapper.properties 2022-03-10 01:21:19 +06:00
dfd1ba807f start 0.10.0 2022-03-10 01:12:41 +06:00
e926a5422d Update build_and_publish.yml 2021-09-22 20:16:31 +06:00
d631d63490 Merge pull request #108 from InsanusMokrassar/0.9.1
0.9.1
2021-09-21 15:28:38 +06:00
60ae527dd0 small fix 2021-09-21 15:18:48 +06:00
05b8d7738f extension ResultData#urls 2021-09-21 15:10:33 +06:00
b5ceff32bd add several extensions to ResultData: authors, froms, charactersList, titles 2021-09-21 14:47:40 +06:00
64109735f8 update dependencies 2021-09-21 14:44:21 +06:00
d4f902aefd start 0.9.1 2021-09-21 14:42:52 +06:00
2de15a54a1 Merge pull request #104 from InsanusMokrassar/0.9.0
0.9.0
2021-08-31 11:47:54 +06:00
036deeb318 Update README.md 2021-08-31 11:46:59 +06:00
4cc0223fbc update dependencies 2021-08-31 11:29:46 +06:00
be292102aa start 0.9.0 2021-08-31 11:21:41 +06:00
9d473857be Merge pull request #94 from InsanusMokrassar/0.8.2
0.8.2
2021-05-26 22:37:24 +06:00
6ff3f76295 fixes of publish scripts 2021-05-26 22:36:00 +06:00
0ed1a8702b fix deprecations 2021-05-26 22:16:08 +06:00
c800a81a41 update publish scripts 2021-05-26 22:10:53 +06:00
62ceae0066 update klock 2021-05-26 22:02:16 +06:00
8619d020f6 Merge branch 'master' into 0.8.2 2021-05-26 21:58:29 +06:00
affa06905e Create build_and_publish.yml 2021-05-26 21:57:39 +06:00
cbe76b3d95 update gradle wrapper 2021-05-26 21:42:51 +06:00
9f4feeccfc update dependencies 2021-05-26 21:39:42 +06:00
037074cef6 start 0.8.2 2021-05-26 21:37:34 +06:00
dfe29296ab 0.8.1 changelog 2021-04-07 20:09:11 +06:00
ce1d185eff 0.8.1 + dependencies update 2021-04-07 20:00:20 +06:00
a78611a27c Merge pull request #75 from InsanusMokrassar/0.8.0
0.8.0
2021-03-08 00:39:19 +06:00
15 changed files with 2120 additions and 35 deletions

24
.github/workflows/build_and_publish.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Publish package to GitHub Packages
on: [push]
jobs:
publishing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Rewrite version
run: |
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
cat gradle.properties | sed -e "s/^library_version=\([0-9\.]*\)/library_version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
rm gradle.properties
mv gradle.properties.tmp gradle.properties
- name: Build
run: ./gradlew build
- name: Publish
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel -x signJsPublication -x signJvmPublication -x signKotlinMultiplatformPublication
continue-on-error: true
env:
GITHUBPACKAGES_USER: ${{ github.actor }}
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,5 +1,48 @@
# SauceNaoAPI Changelog
## 0.10.1
* Versions updates:
* `Klock`: `2.6.2` -> `2.6.3`
* `Ktor`: `1.6.7` -> `1.6.8`
## 0.10.0
Migration onto libs versions toml
## 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:
* `Kotlin`: `1.5.10` -> `1.5.30`
* `Klock`: `2.1.2` -> `2.4.0`
* `Ktor`: `1.5.4` -> `1.6.3`
* `Serialization`: `1.2.1` -> `1.2.2`
* `Coroutines`: `1.5.0` -> `1.5.1`
## 0.8.2
* Versions updates:
* `Kotlin`: `1.4.32` -> `1.5.10`
* `Klock`: `2.0.7` -> `2.1.2`
* `Ktor`: `1.5.3` -> `1.5.4`
* `Serialization`: `1.1.0` -> `1.2.1`
* `Coroutines`: `1.4.3` -> `1.5.0`
## 0.8.1
* Versions updates:
* `Kotlin`: `1.4.31` -> `1.4.32`
* `Klock`: `2.0.6` -> `2.0.7`
* `Ktor`: `1.5.2` -> `1.5.3`
## 0.8.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,20 +1,19 @@
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.github.breadmoirai:github-release:$gradle_github_release_plugin_version"
classpath libs.buildscript.kt.gradle
classpath libs.buildscript.kt.serialization
classpath libs.buildscript.gh.release
}
}
plugins {
id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version"
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version"
alias(libs.plugins.multiplatform)
alias(libs.plugins.serialization)
}
project.version = "$library_version"
@@ -25,14 +24,12 @@ apply from: "github_release.gradle"
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
kotlin {
jvm()
js(BOTH) {
js(IR) {
browser()
nodejs()
}
@@ -43,10 +40,10 @@ kotlin {
dependencies {
implementation kotlin('stdlib')
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_version"
api "com.soywiz.korlibs.klock:klock:$klock_version"
api "io.ktor:ktor-client-core:$ktor_version"
api libs.kt.coroutines
api libs.kt.serialization
api libs.klock
api libs.ktor.client
}
}
commonTest {
@@ -58,7 +55,7 @@ kotlin {
jvmTest {
dependencies {
implementation kotlin('test-junit')
implementation "io.ktor:ktor-client-okhttp:$ktor_version"
implementation libs.ktor.client.okhttp
}
}
jsTest {

View File

@@ -1,10 +1,3 @@
kotlin.code.style=official
kotlin_version=1.4.31
kotlin_coroutines_version=1.4.3
kotlin_serialisation_version=1.1.0
klock_version=2.0.6
ktor_version=1.5.2
gradle_github_release_plugin_version=2.2.12
library_version=0.8.0
library_version=0.10.1

30
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,30 @@
[versions]
kt = "1.6.10"
kt-serialization = "1.3.2"
kt-coroutines = "1.6.0"
klock = "2.6.3"
ktor = "1.6.8"
gh-release = "2.2.12"
[libraries]
kt-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kt" }
kt-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kt-serialization" }
kt-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kt-coroutines" }
klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "klock" }
ktor-client = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
buildscript-kt-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kt" }
buildscript-kt-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kt" }
buildscript-gh-release = { module = "com.github.breadmoirai:github-release", version.ref = "gh-release" }
[plugins]
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kt" }
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kt" }

View File

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip

1960
kotlin-js-store/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'
task javadocsJar(type: Jar) {
classifier = 'javadoc'
@@ -39,6 +38,16 @@ publishing {
}
}
repositories {
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/InsanusMokrassar/SauceNaoAPI")
credentials {
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
}
}
}
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
maven {
name = "sonatype"
@@ -52,8 +61,19 @@ publishing {
}
}
}
signing {
useGpgCmd()
sign publishing.publications
if (project.hasProperty("signing.gnupg.keyName")) {
apply plugin: 'signing'
signing {
useGpgCmd()
sign publishing.publications
}
task signAll {
tasks.withType(Sign).forEach {
dependsOn(it)
}
}
}

View File

@@ -1 +1 @@
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/SauceNaoAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"SauceNao API","description":"SauceNao API library","url":"https://insanusmokrassar.github.io/${project.name}","vcsUrl":"https://github.com/insanusmokrassar/${project.name}.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsyannikov Alexey","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}}
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/SauceNaoAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"SauceNao API","description":"SauceNao API library","url":"https://insanusmokrassar.github.io/${project.name}","vcsUrl":"https://github.com/insanusmokrassar/${project.name}.git","developers":[{"id":"InsanusMokrassar","name":"Ovsyannikov Alexey","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/SauceNaoAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}

View File

@@ -1 +1,3 @@
rootProject.name = 'saucenaoapi'
enableFeaturePreview("VERSION_CATALOGS")

View File

@@ -158,7 +158,7 @@ data class SauceNaoAPI(
minSimilarity: Float? = null
): SauceNaoAnswer? {
return suspendCoroutine<SauceNaoAnswer> {
requestsChannel.offer(
requestsChannel.trySend(
it to HttpRequestBuilder().apply {
url(searchUrl)
@@ -212,4 +212,4 @@ data class SauceNaoAPI(
timeManager.close()
quotaManager.close()
}
}
}

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

View File

@@ -92,7 +92,7 @@ internal class RequestQuotaManager (
quotaActions.send(callback)
}
}
quotaActions.offer(callback)
quotaActions.trySend(callback)
}
}

View File

@@ -84,7 +84,7 @@ internal class TimeManager(
suspend fun getMostOldestInLongPeriod(): DateTime? {
return suspendCoroutine {
actionsChannel.offer(
actionsChannel.trySend(
TimeManagerMostOldestInLongGetter(it)
)
}
@@ -92,7 +92,7 @@ internal class TimeManager(
suspend fun getMostOldestInShortPeriod(): DateTime? {
return suspendCoroutine {
actionsChannel.offer(TimeManagerMostOldestInShortGetter(it))
actionsChannel.trySend(TimeManagerMostOldestInShortGetter(it))
}
}