mirror of
https://github.com/InsanusMokrassar/SauceNaoAPI.git
synced 2025-12-17 02:15:43 +00:00
Compare commits
26 Commits
0.15.1
...
renovate/k
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71b8856ece | ||
| a97c117288 | |||
| d5f09c6028 | |||
| 7cd2744a64 | |||
| a2e2f48d53 | |||
| 75f56f0aee | |||
| b810fa40c2 | |||
| 081d567ba1 | |||
| 5a3b0362fa | |||
| 1fdbd9b8e6 | |||
| 2fe0d5c170 | |||
| c2c8ffe19b | |||
| a61211e24a | |||
| caa2fb9b58 | |||
| 915cb09e37 | |||
| 930523f69a | |||
| 773415f579 | |||
| 21803cb321 | |||
| c6643dbdbc | |||
| 58beceebf1 | |||
| 0acf4a88f4 | |||
| ed48b3e4aa | |||
| 1ed123596c | |||
| 76a0dbdf27 | |||
| 33775f3304 | |||
| f7ca2bda89 |
7
.github/workflows/build_and_publish.yml
vendored
7
.github/workflows/build_and_publish.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 17
|
||||||
- name: Rewrite version
|
- name: Rewrite version
|
||||||
run: |
|
run: |
|
||||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||||
@@ -16,11 +16,6 @@ jobs:
|
|||||||
mv gradle.properties.tmp gradle.properties
|
mv gradle.properties.tmp gradle.properties
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
- name: Publish to Gitea
|
|
||||||
continue-on-error: true
|
|
||||||
run: ./gradlew publishAllPublicationsToGiteaRepository
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.kotlin
|
||||||
out/*
|
out/*
|
||||||
*.iml
|
*.iml
|
||||||
target
|
target
|
||||||
|
|||||||
50
CHANGELOG.md
50
CHANGELOG.md
@@ -1,5 +1,55 @@
|
|||||||
# SauceNaoAPI Changelog
|
# SauceNaoAPI Changelog
|
||||||
|
|
||||||
|
## 0.19.0
|
||||||
|
|
||||||
|
* Versions:
|
||||||
|
* `Kotlin`: `2.2.20`
|
||||||
|
* `Coroutines`: `1.10.2`
|
||||||
|
* `Serialization`: `1.9.0`
|
||||||
|
* `Ktor`: `3.3.0`
|
||||||
|
* `MicroUtils`: `0.26.5`
|
||||||
|
|
||||||
|
## 0.18.0
|
||||||
|
|
||||||
|
* Versions:
|
||||||
|
* `Kotlin`: `2.1.0`
|
||||||
|
* `Serialization`: `1.7.3`
|
||||||
|
* `Coroutines`: `1.9.0`
|
||||||
|
* `Ktor`: `3.0.2`
|
||||||
|
* `MicroUtils`: `0.23.2`
|
||||||
|
* `Klock`: `5.4.0`
|
||||||
|
|
||||||
|
## 0.17.2
|
||||||
|
|
||||||
|
* Versions:
|
||||||
|
* `Coroutines`: `1.7.3`
|
||||||
|
* `Ktor`: `2.3.4`
|
||||||
|
* `MicroUtils`: `0.19.9`
|
||||||
|
|
||||||
|
## 0.17.1
|
||||||
|
|
||||||
|
* Versions:
|
||||||
|
* `Coroutines`: `1.7.2`
|
||||||
|
* `Ktor`: `2.3.2`
|
||||||
|
* `MicroUtils`: `0.19.7`
|
||||||
|
|
||||||
|
## 0.17.0
|
||||||
|
|
||||||
|
* Versions:
|
||||||
|
* `Kotlin`: `1.8.22`
|
||||||
|
* `Serialization`: `1.5.1`
|
||||||
|
* `Ktor`: `2.3.1`
|
||||||
|
* `MicroUtils`: `0.19.2`
|
||||||
|
* `Klock`: `4.0.3`
|
||||||
|
|
||||||
|
## 0.16.0
|
||||||
|
|
||||||
|
Add `MicroUtils` as used micro utils
|
||||||
|
|
||||||
|
* Versions:
|
||||||
|
* `Kotlin`: `1.8.21`
|
||||||
|
* `Ktor`: `2.3.0`
|
||||||
|
|
||||||
## 0.15.1
|
## 0.15.1
|
||||||
|
|
||||||
* Versions:
|
* Versions:
|
||||||
|
|||||||
37
build.gradle
37
build.gradle
@@ -1,7 +1,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -14,6 +14,7 @@ buildscript {
|
|||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.multiplatform)
|
alias(libs.plugins.multiplatform)
|
||||||
alias(libs.plugins.serialization)
|
alias(libs.plugins.serialization)
|
||||||
|
alias(libs.plugins.nmcp.aggregation)
|
||||||
}
|
}
|
||||||
|
|
||||||
project.version = "$library_version"
|
project.version = "$library_version"
|
||||||
@@ -23,16 +24,25 @@ apply from: "publish.gradle"
|
|||||||
apply from: "github_release.gradle"
|
apply from: "github_release.gradle"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
||||||
|
mavenLocal()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm {
|
||||||
|
compilations.main {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
js(IR) {
|
js(IR) {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
linuxX64()
|
||||||
|
mingwX64()
|
||||||
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -44,6 +54,9 @@ kotlin {
|
|||||||
api libs.kt.serialization
|
api libs.kt.serialization
|
||||||
api libs.klock
|
api libs.klock
|
||||||
api libs.ktor.client
|
api libs.ktor.client
|
||||||
|
api libs.microutils.common
|
||||||
|
api libs.microutils.ktor.common
|
||||||
|
api libs.microutils.mimetypes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commonTest {
|
commonTest {
|
||||||
@@ -65,3 +78,21 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||||
|
nmcpAggregation {
|
||||||
|
centralPortal {
|
||||||
|
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||||
|
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||||
|
validationTimeout = Duration.ofHours(4)
|
||||||
|
publishingType = System.getenv('PUBLISHING_TYPE') != "" ? System.getenv('PUBLISHING_TYPE') : "USER_MANAGED"
|
||||||
|
}
|
||||||
|
|
||||||
|
publishAllProjectsProbablyBreakingProjectIsolation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ if (new File(projectDir, "secret.gradle").exists()) {
|
|||||||
githubRelease {
|
githubRelease {
|
||||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
||||||
|
|
||||||
owner "InsanusMokrassar"
|
owner = "InsanusMokrassar"
|
||||||
repo "${rootProject.name}"
|
repo = "${rootProject.name}"
|
||||||
|
|
||||||
tagName "v${project.version}"
|
tagName = "v${project.version}"
|
||||||
releaseName "${project.version}"
|
releaseName = "${project.version}"
|
||||||
targetCommitish "${project.version}"
|
targetCommitish = "${project.version}"
|
||||||
|
|
||||||
body getCurrentVersionChangelog()
|
body = getCurrentVersionChangelog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
|
|
||||||
library_version=0.15.1
|
library_version=0.19.0
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kt = "1.8.10"
|
kt = "2.3.0"
|
||||||
kt-serialization = "1.5.0"
|
kt-coroutines = "1.10.2"
|
||||||
kt-coroutines = "1.6.4"
|
kt-serialization = "1.9.0"
|
||||||
|
|
||||||
klock = "3.4.0"
|
klock = "5.4.0"
|
||||||
ktor = "2.2.4"
|
ktor = "3.3.0"
|
||||||
|
|
||||||
gh-release = "2.4.1"
|
microutils = "0.26.5"
|
||||||
|
|
||||||
|
gh-release = "2.5.2"
|
||||||
|
nmcp = "1.2.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
@@ -15,11 +18,15 @@ 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-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" }
|
kt-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kt-coroutines" }
|
||||||
|
|
||||||
klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "klock" }
|
klock = { module = "com.soywiz.korge:korlibs-time", version.ref = "klock" }
|
||||||
|
|
||||||
ktor-client = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
|
ktor-client = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
|
||||||
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
|
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
|
||||||
|
|
||||||
|
microutils-common = { module = "dev.inmo:micro_utils.common", version.ref = "microutils" }
|
||||||
|
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
||||||
|
microutils-mimetypes = { module = "dev.inmo:micro_utils.mime_types", version.ref = "microutils" }
|
||||||
|
|
||||||
buildscript-kt-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kt" }
|
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-kt-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kt" }
|
||||||
buildscript-gh-release = { module = "com.github.breadmoirai:github-release", version.ref = "gh-release" }
|
buildscript-gh-release = { module = "com.github.breadmoirai:github-release", version.ref = "gh-release" }
|
||||||
@@ -28,3 +35,5 @@ buildscript-gh-release = { module = "com.github.breadmoirai:github-release", ver
|
|||||||
|
|
||||||
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kt" }
|
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kt" }
|
||||||
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kt" }
|
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kt" }
|
||||||
|
|
||||||
|
nmcp-aggregation = { id = "com.gradleup.nmcp.aggregation", version.ref = "nmcp" }
|
||||||
|
|||||||
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
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||||
|
|||||||
117
publish.gradle
117
publish.gradle
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
task javadocsJar(type: Jar) {
|
task javadocsJar(type: Jar) {
|
||||||
classifier = 'javadoc'
|
archiveClassifier = 'javadoc'
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
@@ -19,63 +20,52 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
|
developer {
|
||||||
developer {
|
id = "InsanusMokrassar"
|
||||||
id = "InsanusMokrassar"
|
name = "Ovsyannikov Alexey"
|
||||||
name = "Ovsyannikov Alexey"
|
email = "ovsyannikov.alexey95@gmail.com"
|
||||||
email = "ovsyannikov.alexey95@gmail.com"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
licenses {
|
licenses {
|
||||||
|
license {
|
||||||
license {
|
name = "Apache Software License 2.0"
|
||||||
name = "Apache Software License 2.0"
|
url = "https://github.com/InsanusMokrassar/SauceNaoAPI/blob/master/LICENSE"
|
||||||
url = "https://github.com/InsanusMokrassar/SauceNaoAPI/blob/master/LICENSE"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
}
|
||||||
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
|
repositories {
|
||||||
maven {
|
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
|
||||||
name = "GithubPackages"
|
maven {
|
||||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/SauceNaoAPI")
|
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')
|
credentials {
|
||||||
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
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('GITEA_TOKEN') || System.getenv('GITEA_TOKEN') != null) {
|
}
|
||||||
maven {
|
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
|
||||||
name = "Gitea"
|
maven {
|
||||||
url = uri("https://git.inmo.dev/api/packages/InsanusMokrassar/maven")
|
name = "InmoNexus"
|
||||||
|
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
|
||||||
credentials(HttpHeaderCredentials) {
|
|
||||||
name = "Authorization"
|
credentials {
|
||||||
value = project.hasProperty('GITEA_TOKEN') ? project.property('GITEA_TOKEN') : System.getenv('GITEA_TOKEN')
|
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
|
||||||
}
|
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
|
||||||
|
|
||||||
authentication {
|
|
||||||
header(HttpHeaderAuthentication)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
}
|
||||||
maven {
|
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||||
name = "sonatype"
|
maven {
|
||||||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
name = "sonatype"
|
||||||
|
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||||
credentials {
|
|
||||||
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
credentials {
|
||||||
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||||
}
|
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,16 +74,39 @@ publishing {
|
|||||||
|
|
||||||
if (project.hasProperty("signing.gnupg.keyName")) {
|
if (project.hasProperty("signing.gnupg.keyName")) {
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
useGpgCmd()
|
useGpgCmd()
|
||||||
|
|
||||||
sign publishing.publications
|
sign publishing.publications
|
||||||
}
|
}
|
||||||
|
|
||||||
task signAll {
|
task signAll {
|
||||||
tasks.withType(Sign).forEach {
|
tasks.withType(Sign).forEach {
|
||||||
dependsOn(it)
|
dependsOn(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround to make android sign operations depend on signing tasks
|
||||||
|
project.getTasks().withType(AbstractPublishToMaven.class).configureEach {
|
||||||
|
def signingTasks = project.getTasks().withType(Sign.class)
|
||||||
|
mustRunAfter(signingTasks)
|
||||||
|
}
|
||||||
|
// Workaround to make test tasks use sign
|
||||||
|
project.getTasks().withType(Sign.class).configureEach { signTask ->
|
||||||
|
def withoutSign = (signTask.name.startsWith("sign") ? signTask.name.minus("sign") : signTask.name)
|
||||||
|
def pubName = withoutSign.endsWith("Publication") ? withoutSign.substring(0, withoutSign.length() - "Publication".length()) : withoutSign
|
||||||
|
// These tasks only exist for native targets, hence findByName() to avoid trying to find them for other targets
|
||||||
|
|
||||||
|
// Task ':linkDebugTest<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
||||||
|
def debugTestTask = tasks.findByName("linkDebugTest$pubName")
|
||||||
|
if (debugTestTask != null) {
|
||||||
|
signTask.mustRunAfter(debugTestTask)
|
||||||
|
}
|
||||||
|
// Task ':compileTestKotlin<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
||||||
|
def testTask = tasks.findByName("compileTestKotlin$pubName")
|
||||||
|
if (testTask != null) {
|
||||||
|
signTask.mustRunAfter(testTask)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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","developers":[{"id":"InsanusMokrassar","name":"Ovsyannikov Alexey","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/SauceNaoAPI"},{"name":"Gitea","url":"https://git.inmo.dev/api/packages/InsanusMokrassar/maven","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.HttpHeaderCredentials","headerName":"Authorization","headerValueProperty":"GITEA_TOKEN"}},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
{"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":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
||||||
@@ -1,3 +1 @@
|
|||||||
rootProject.name = 'saucenaoapi'
|
rootProject.name = 'saucenaoapi'
|
||||||
|
|
||||||
enableFeaturePreview("VERSION_CATALOGS")
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package dev.inmo.saucenaoapi
|
package dev.inmo.saucenaoapi
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.common.MPPFile
|
||||||
|
import dev.inmo.micro_utils.ktor.common.input
|
||||||
import dev.inmo.saucenaoapi.exceptions.TooManyRequestsException
|
import dev.inmo.saucenaoapi.exceptions.TooManyRequestsException
|
||||||
import dev.inmo.saucenaoapi.exceptions.sauceNaoAPIException
|
import dev.inmo.saucenaoapi.exceptions.sauceNaoAPIException
|
||||||
import dev.inmo.saucenaoapi.models.*
|
import dev.inmo.saucenaoapi.models.*
|
||||||
@@ -189,7 +191,7 @@ data class SauceNaoAPI(
|
|||||||
resultsCount: Int? = null,
|
resultsCount: Int? = null,
|
||||||
minSimilarity: Float? = null
|
minSimilarity: Float? = null
|
||||||
): SauceNaoAnswer = request(
|
): SauceNaoAnswer = request(
|
||||||
file.input,
|
file.input(),
|
||||||
file.contentType,
|
file.contentType,
|
||||||
resultsCount,
|
resultsCount,
|
||||||
minSimilarity
|
minSimilarity
|
||||||
@@ -206,7 +208,7 @@ data class SauceNaoAPI(
|
|||||||
resultsCount: Int? = null,
|
resultsCount: Int? = null,
|
||||||
minSimilarity: Float? = null
|
minSimilarity: Float? = null
|
||||||
): SauceNaoAnswer = requestByDBs(
|
): SauceNaoAnswer = requestByDBs(
|
||||||
file.input,
|
file.input(),
|
||||||
file.contentType,
|
file.contentType,
|
||||||
db,
|
db,
|
||||||
dbs,
|
dbs,
|
||||||
@@ -228,7 +230,7 @@ data class SauceNaoAPI(
|
|||||||
resultsCount: Int? = null,
|
resultsCount: Int? = null,
|
||||||
minSimilarity: Float? = null
|
minSimilarity: Float? = null
|
||||||
): SauceNaoAnswer = requestByMasks(
|
): SauceNaoAnswer = requestByMasks(
|
||||||
file.input,
|
file.input(),
|
||||||
file.contentType,
|
file.contentType,
|
||||||
mask,
|
mask,
|
||||||
excludedMask,
|
excludedMask,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.saucenaoapi.additional
|
package dev.inmo.saucenaoapi.additional
|
||||||
|
|
||||||
import com.soywiz.klock.TimeSpan
|
import korlibs.time.TimeSpan
|
||||||
|
|
||||||
typealias AccountType = Int
|
typealias AccountType = Int
|
||||||
const val defaultAccountType: AccountType = 1 // "basic"
|
const val defaultAccountType: AccountType = 1 // "basic"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.saucenaoapi.exceptions
|
package dev.inmo.saucenaoapi.exceptions
|
||||||
|
|
||||||
import com.soywiz.klock.TimeSpan
|
import korlibs.time.TimeSpan
|
||||||
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
||||||
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
||||||
import io.ktor.client.plugins.ClientRequestException
|
import io.ktor.client.plugins.ClientRequestException
|
||||||
|
|||||||
@@ -1,9 +1,26 @@
|
|||||||
package dev.inmo.saucenaoapi.utils
|
package dev.inmo.saucenaoapi.utils
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.common.MPPFile
|
||||||
|
import dev.inmo.micro_utils.common.filename
|
||||||
|
import dev.inmo.micro_utils.ktor.common.input
|
||||||
|
import dev.inmo.micro_utils.mime_types.KnownMimeTypes
|
||||||
|
import dev.inmo.micro_utils.mime_types.getMimeType
|
||||||
import io.ktor.http.ContentType
|
import io.ktor.http.ContentType
|
||||||
import io.ktor.utils.io.core.Input
|
import io.ktor.utils.io.core.Input
|
||||||
|
|
||||||
expect class MPPFile
|
@Deprecated(
|
||||||
|
"MPPFile from microutils is preferable since 0.16.0",
|
||||||
|
ReplaceWith("MPPFile", "dev.inmo.micro_utils.common.MPPFile")
|
||||||
|
)
|
||||||
|
typealias MPPFile = MPPFile
|
||||||
|
|
||||||
expect val MPPFile.input: Input
|
@Deprecated(
|
||||||
expect val MPPFile.contentType: ContentType
|
"input() from microutils is preferable since 0.16.0",
|
||||||
|
ReplaceWith("this.input()", "dev.inmo.micro_utils.ktor.common.input")
|
||||||
|
)
|
||||||
|
val MPPFile.input: Input
|
||||||
|
get() = input()
|
||||||
|
val MPPFile.contentType: ContentType
|
||||||
|
get() = ContentType.parse(
|
||||||
|
getMimeType(stringWithExtension = filename.extension) ?.raw ?: KnownMimeTypes.Any.raw
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
package dev.inmo.saucenaoapi.utils
|
package dev.inmo.saucenaoapi.utils
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
||||||
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
||||||
import dev.inmo.saucenaoapi.exceptions.TooManyRequestsException
|
import dev.inmo.saucenaoapi.exceptions.TooManyRequestsException
|
||||||
import dev.inmo.saucenaoapi.exceptions.TooManyRequestsLongException
|
import dev.inmo.saucenaoapi.exceptions.TooManyRequestsLongException
|
||||||
import dev.inmo.saucenaoapi.models.Header
|
import dev.inmo.saucenaoapi.models.Header
|
||||||
import dev.inmo.saucenaoapi.models.LimitsState
|
import dev.inmo.saucenaoapi.models.LimitsState
|
||||||
|
import korlibs.time.millisecondsLong
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.channels.Channel
|
import kotlinx.coroutines.channels.Channel
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.saucenaoapi.utils
|
package dev.inmo.saucenaoapi.utils
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
||||||
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
package dev.inmo.saucenaoapi.utils
|
|
||||||
|
|
||||||
import io.ktor.http.ContentType
|
|
||||||
import io.ktor.utils.io.core.ByteReadPacket
|
|
||||||
import io.ktor.utils.io.core.Input
|
|
||||||
import org.khronos.webgl.Int8Array
|
|
||||||
import org.w3c.files.File
|
|
||||||
import org.w3c.files.FileReaderSync
|
|
||||||
|
|
||||||
actual typealias MPPFile = File
|
|
||||||
|
|
||||||
actual val MPPFile.input: Input
|
|
||||||
get() {
|
|
||||||
val reader = FileReaderSync()
|
|
||||||
return ByteReadPacket(Int8Array(reader.readAsArrayBuffer(this)) as ByteArray)
|
|
||||||
}
|
|
||||||
actual val MPPFile.contentType: ContentType
|
|
||||||
get() = ContentType.parse(type)
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package dev.inmo.saucenaoapi.utils
|
|
||||||
|
|
||||||
import io.ktor.http.ContentType
|
|
||||||
import io.ktor.utils.io.core.Input
|
|
||||||
import io.ktor.utils.io.streams.asInput
|
|
||||||
import java.io.File
|
|
||||||
import java.nio.file.Files
|
|
||||||
|
|
||||||
actual typealias MPPFile = File
|
|
||||||
|
|
||||||
actual val MPPFile.input: Input
|
|
||||||
get() = inputStream().asInput()
|
|
||||||
actual val MPPFile.contentType: ContentType
|
|
||||||
get() = ContentType.parse(Files.probeContentType(toPath()))
|
|
||||||
Reference in New Issue
Block a user