mirror of
https://github.com/InsanusMokrassar/SauceNaoAPI.git
synced 2025-12-08 14:05:46 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60ae527dd0 | |||
| 05b8d7738f | |||
| b5ceff32bd | |||
| 64109735f8 | |||
| d4f902aefd | |||
| 2de15a54a1 | |||
| 036deeb318 | |||
| 4cc0223fbc | |||
| be292102aa | |||
| 9d473857be | |||
| 6ff3f76295 | |||
| 0ed1a8702b | |||
| c800a81a41 | |||
| 62ceae0066 | |||
| 8619d020f6 | |||
| affa06905e | |||
| cbe76b3d95 | |||
| 9f4feeccfc | |||
| 037074cef6 |
23
.github/workflows/build_and_publish.yml
vendored
Normal file
23
.github/workflows/build_and_publish.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
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: 1.8
|
||||
- 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
|
||||
env:
|
||||
GITHUBPACKAGES_USER: ${{ github.actor }}
|
||||
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||
26
CHANGELOG.md
26
CHANGELOG.md
@@ -1,5 +1,31 @@
|
||||
# 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:
|
||||
* `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:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# SauceNaoAPI
|
||||
|
||||
[  ](https://bintray.com/insanusmokrassar/SauceNaoAPI/saucenaoapi/_latestVersion)
|
||||
[](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
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
@@ -32,7 +31,7 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
js(BOTH) {
|
||||
js(IR) {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
kotlin.code.style=official
|
||||
kotlin_version=1.4.32
|
||||
kotlin_coroutines_version=1.4.3
|
||||
kotlin_serialisation_version=1.1.0
|
||||
klock_version=2.0.7
|
||||
ktor_version=1.5.3
|
||||
kotlin_version=1.5.31
|
||||
kotlin_coroutines_version=1.5.2
|
||||
kotlin_serialisation_version=1.2.2
|
||||
klock_version=2.4.2
|
||||
ktor_version=1.6.3
|
||||
|
||||
gradle_github_release_plugin_version=2.2.12
|
||||
|
||||
library_version=0.8.1
|
||||
library_version=0.9.1
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -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.2-bin.zip
|
||||
|
||||
@@ -39,6 +39,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"
|
||||
|
||||
@@ -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","includeGpgSigning":true,"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/"}]}}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -92,7 +92,7 @@ internal class RequestQuotaManager (
|
||||
quotaActions.send(callback)
|
||||
}
|
||||
}
|
||||
quotaActions.offer(callback)
|
||||
quotaActions.trySend(callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user