diff --git a/CHANGELOG.md b/CHANGELOG.md index f9aafe2..ed92c18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # SauceNaoAPI Changelog +## 0.7.0 + +**BREAKING CHANGES: PACKAGE HAS BEEN CHANGED FROM `com.insanusmokrassar` to `dev.inmo`** + +Migration: + +* Packages in the whole project were changed `com.insanusmokrassar.SauceNaoAPI` -> `dev.inmo.saucenaoapi` +* Change implementation in your gradle files: `implementation "com.insanusmokrassar:SauceNaoAPI:*"` -> +`implementation "dev.inmo:saucenaoapi:*"` + ## 0.6.2 * Versions updates: diff --git a/build.gradle b/build.gradle index abc8d13..cefe2dd 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ plugins { } project.version = "$library_version" -project.group = "com.insanusmokrassar" +project.group = "dev.inmo" apply from: "publish.gradle" apply from: "github_release.gradle" diff --git a/gradle.properties b/gradle.properties index 0356736..3b74b5b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,4 +7,4 @@ ktor_version=1.4.3 gradle_github_release_plugin_version=2.2.12 -library_version=0.6.2 +library_version=0.7.0 diff --git a/publication.kpsb b/publication.kpsb index 534a053..cc2a057 100644 --- a/publication.kpsb +++ b/publication.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}-mpp","packageVcs":"https://github.com/InsanusMokrassar/${project.name}","autoPublish":true,"overridePublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/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"}]}} \ No newline at end of file +{"bintrayConfig":{"repo":"SauceNaoAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/${project.name}","autoPublish":true,"overridePublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/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"}]}} \ No newline at end of file diff --git a/publish.gradle b/publish.gradle index 5226b91..8390074 100644 --- a/publish.gradle +++ b/publish.gradle @@ -57,7 +57,7 @@ publishing { repositories { maven { name = "bintray" - url = uri("https://api.bintray.com/maven/${project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')}/InsanusMokrassar/${project.name}-mpp/;publish=1;override=1") + url = uri("https://api.bintray.com/maven/${project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')}/SauceNaoAPI/${project.name}/;publish=1;override=1") credentials { username = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') diff --git a/settings.gradle b/settings.gradle index 640a3b2..82bcc88 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'SauceNaoAPI' +rootProject.name = 'saucenaoapi' diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/OutputType.kt b/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/OutputType.kt deleted file mode 100644 index 77bb84d..0000000 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/OutputType.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.insanusmokrassar.SauceNaoAPI - -sealed class OutputType { - abstract val typeCode: Int -} - -object HtmlOutputType : OutputType() { - override val typeCode: Int = 0 -} - -object XmlOutputType : OutputType() { - override val typeCode: Int = 1 -} - -object JsonOutputType : OutputType() { - override val typeCode: Int = 2 -} diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/AdaptedAnswer.kt b/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/AdaptedAnswer.kt deleted file mode 100644 index 5a76ab0..0000000 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/AdaptedAnswer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.insanusmokrassar.SauceNaoAPI.additional - -import com.insanusmokrassar.SauceNaoAPI.additional.header.ResultMetaInfo -import com.insanusmokrassar.SauceNaoAPI.additional.header.adapted -import com.insanusmokrassar.SauceNaoAPI.additional.results.AdaptedResult -import com.insanusmokrassar.SauceNaoAPI.additional.results.adapted -import com.insanusmokrassar.SauceNaoAPI.models.SauceNaoAnswer - -val SauceNaoAnswer.adapted: AdaptedAnswer - get() = header.adapted.let { resultMetainfo -> - val adaptedResults = results.map { - it.adapted(resultMetainfo) - } - AdaptedAnswer( - resultMetainfo, - adaptedResults - ) - } - -data class AdaptedAnswer( - val resultMetaInfo: ResultMetaInfo, - val results: List -) diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/results/ResultHeader.kt b/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/results/ResultHeader.kt deleted file mode 100644 index 68d4770..0000000 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/results/ResultHeader.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.insanusmokrassar.SauceNaoAPI.additional.results - -import com.insanusmokrassar.SauceNaoAPI.additional.header.IndexInfo - -data class ResultHeader( - val similarity: Float, - val thumbnail: String, - val index: IndexInfo -) diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/SleepCalculations.kt b/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/SleepCalculations.kt deleted file mode 100644 index f279599..0000000 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/SleepCalculations.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.insanusmokrassar.SauceNaoAPI.utils - -import com.insanusmokrassar.SauceNaoAPI.additional.LONG_TIME_RECALCULATING_MILLIS -import com.insanusmokrassar.SauceNaoAPI.additional.SHORT_TIME_RECALCULATING_MILLIS -import com.insanusmokrassar.SauceNaoAPI.models.Header -import com.soywiz.klock.DateTime - -internal suspend fun calculateSleepTime( - header: Header, - mostOldestInShortPeriodGetter: suspend () -> DateTime?, - mostOldestInLongPeriodGetter: suspend () -> DateTime? -): DateTime? { - return when { - header.longRemaining < 1 -> mostOldestInLongPeriodGetter() ?.plus(LONG_TIME_RECALCULATING_MILLIS) - header.shortRemaining < 1 -> mostOldestInShortPeriodGetter() ?.plus(SHORT_TIME_RECALCULATING_MILLIS) - else -> null - } -} \ No newline at end of file diff --git a/src/commonMain/kotlin/dev/inmo/saucenaoapi/OutputType.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/OutputType.kt new file mode 100644 index 0000000..15951c9 --- /dev/null +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/OutputType.kt @@ -0,0 +1,17 @@ +package dev.inmo.saucenaoapi + +sealed class OutputType { + abstract val typeCode: Int +} + +object HtmlOutputType : dev.inmo.saucenaoapi.OutputType() { + override val typeCode: Int = 0 +} + +object XmlOutputType : dev.inmo.saucenaoapi.OutputType() { + override val typeCode: Int = 1 +} + +object JsonOutputType : dev.inmo.saucenaoapi.OutputType() { + override val typeCode: Int = 2 +} diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/SauceNaoAPI.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/SauceNaoAPI.kt similarity index 95% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/SauceNaoAPI.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/SauceNaoAPI.kt index 3b776e8..4966c38 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/SauceNaoAPI.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/SauceNaoAPI.kt @@ -1,9 +1,9 @@ -package com.insanusmokrassar.SauceNaoAPI +package dev.inmo.saucenaoapi -import com.insanusmokrassar.SauceNaoAPI.exceptions.TooManyRequestsException -import com.insanusmokrassar.SauceNaoAPI.exceptions.sauceNaoAPIException -import com.insanusmokrassar.SauceNaoAPI.models.* -import com.insanusmokrassar.SauceNaoAPI.utils.* +import dev.inmo.saucenaoapi.exceptions.TooManyRequestsException +import dev.inmo.saucenaoapi.exceptions.sauceNaoAPIException +import dev.inmo.saucenaoapi.models.* +import dev.inmo.saucenaoapi.utils.* import io.ktor.client.HttpClient import io.ktor.client.features.ClientRequestException import io.ktor.client.request.* @@ -40,7 +40,7 @@ val defaultSauceNaoParser = Json { data class SauceNaoAPI( private val apiToken: String? = null, - private val outputType: OutputType = JsonOutputType, + private val outputType: dev.inmo.saucenaoapi.OutputType = dev.inmo.saucenaoapi.JsonOutputType, private val client: HttpClient = HttpClient(), private val searchUrl: String = SEARCH_URL, private val scope: CoroutineScope = CoroutineScope(Dispatchers.Default), diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/SauceRequestSubject.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/SauceRequestSubject.kt similarity index 92% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/SauceRequestSubject.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/SauceRequestSubject.kt index 680e802..3eca172 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/SauceRequestSubject.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/SauceRequestSubject.kt @@ -1,4 +1,4 @@ -package com.insanusmokrassar.SauceNaoAPI +package dev.inmo.saucenaoapi import io.ktor.http.ContentType import io.ktor.utils.io.core.Input diff --git a/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/AdaptedAnswer.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/AdaptedAnswer.kt new file mode 100644 index 0000000..fa85915 --- /dev/null +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/AdaptedAnswer.kt @@ -0,0 +1,23 @@ +package dev.inmo.saucenaoapi.additional + +import dev.inmo.saucenaoapi.additional.header.ResultMetaInfo +import dev.inmo.saucenaoapi.additional.header.adapted +import dev.inmo.saucenaoapi.additional.results.AdaptedResult +import dev.inmo.saucenaoapi.additional.results.adapted +import dev.inmo.saucenaoapi.models.SauceNaoAnswer + +val SauceNaoAnswer.adapted: AdaptedAnswer + get() = header.adapted.let { resultMetainfo -> + val adaptedResults = results.map { + it.adapted(resultMetainfo) + } + AdaptedAnswer( + resultMetainfo, + adaptedResults + ) + } + +data class AdaptedAnswer( + val resultMetaInfo: ResultMetaInfo, + val results: List +) diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/Utils.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/Utils.kt similarity index 84% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/Utils.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/Utils.kt index e30b422..36b0dcb 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/Utils.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/Utils.kt @@ -1,4 +1,4 @@ -package com.insanusmokrassar.SauceNaoAPI.additional +package dev.inmo.saucenaoapi.additional import com.soywiz.klock.TimeSpan diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/AccountInfo.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/AccountInfo.kt similarity index 82% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/AccountInfo.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/AccountInfo.kt index 4dc30da..d9603d6 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/AccountInfo.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/AccountInfo.kt @@ -1,7 +1,7 @@ -package com.insanusmokrassar.SauceNaoAPI.additional.header +package dev.inmo.saucenaoapi.additional.header -import com.insanusmokrassar.SauceNaoAPI.additional.* -import com.insanusmokrassar.SauceNaoAPI.models.Header +import dev.inmo.saucenaoapi.additional.* +import dev.inmo.saucenaoapi.models.Header val Header.shortLimitStatus: LimitStatus get() = LimitStatus( diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/IndexInfo.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/IndexInfo.kt similarity index 81% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/IndexInfo.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/IndexInfo.kt index 574e43a..930235d 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/IndexInfo.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/IndexInfo.kt @@ -1,6 +1,6 @@ -package com.insanusmokrassar.SauceNaoAPI.additional.header +package dev.inmo.saucenaoapi.additional.header -import com.insanusmokrassar.SauceNaoAPI.models.Header +import dev.inmo.saucenaoapi.models.Header data class IndexInfo( val id: Int, diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/QueryResultsMetainfo.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/QueryResultsMetainfo.kt similarity index 89% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/QueryResultsMetainfo.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/QueryResultsMetainfo.kt index 14a4219..4926a45 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/QueryResultsMetainfo.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/QueryResultsMetainfo.kt @@ -1,6 +1,6 @@ -package com.insanusmokrassar.SauceNaoAPI.additional.header +package dev.inmo.saucenaoapi.additional.header -import com.insanusmokrassar.SauceNaoAPI.models.Header +import dev.inmo.saucenaoapi.models.Header val Header.queryPreview get() = QueryResultPreview( diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/ResultMetaInfo.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/ResultMetaInfo.kt similarity index 68% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/ResultMetaInfo.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/ResultMetaInfo.kt index 519335d..7fc8b8a 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/header/ResultMetaInfo.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/header/ResultMetaInfo.kt @@ -1,6 +1,6 @@ -package com.insanusmokrassar.SauceNaoAPI.additional.header +package dev.inmo.saucenaoapi.additional.header -import com.insanusmokrassar.SauceNaoAPI.models.Header +import dev.inmo.saucenaoapi.models.Header data class ResultMetaInfo( val accountInfo: AccountInfo = AccountInfo(), diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/results/AdaptedResult.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/results/AdaptedResult.kt similarity index 55% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/results/AdaptedResult.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/results/AdaptedResult.kt index f4ac074..37ca910 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/additional/results/AdaptedResult.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/results/AdaptedResult.kt @@ -1,9 +1,9 @@ -package com.insanusmokrassar.SauceNaoAPI.additional.results +package dev.inmo.saucenaoapi.additional.results -import com.insanusmokrassar.SauceNaoAPI.additional.header.IndexInfo -import com.insanusmokrassar.SauceNaoAPI.additional.header.ResultMetaInfo -import com.insanusmokrassar.SauceNaoAPI.models.Result -import com.insanusmokrassar.SauceNaoAPI.models.ResultData +import dev.inmo.saucenaoapi.additional.header.IndexInfo +import dev.inmo.saucenaoapi.additional.header.ResultMetaInfo +import dev.inmo.saucenaoapi.models.Result +import dev.inmo.saucenaoapi.models.ResultData fun Result.adapted( resultMetaInfo: ResultMetaInfo diff --git a/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/results/ResultHeader.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/results/ResultHeader.kt new file mode 100644 index 0000000..6fdb203 --- /dev/null +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/additional/results/ResultHeader.kt @@ -0,0 +1,9 @@ +package dev.inmo.saucenaoapi.additional.results + +import dev.inmo.saucenaoapi.additional.header.IndexInfo + +data class ResultHeader( + val similarity: Float, + val thumbnail: String, + val index: IndexInfo +) diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/exceptions/TooManyRequestsException.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/exceptions/TooManyRequestsException.kt similarity index 85% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/exceptions/TooManyRequestsException.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/exceptions/TooManyRequestsException.kt index d150009..57df9cf 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/exceptions/TooManyRequestsException.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/exceptions/TooManyRequestsException.kt @@ -1,7 +1,7 @@ -package com.insanusmokrassar.SauceNaoAPI.exceptions +package dev.inmo.saucenaoapi.exceptions -import com.insanusmokrassar.SauceNaoAPI.additional.LONG_TIME_RECALCULATING_MILLIS -import com.insanusmokrassar.SauceNaoAPI.additional.SHORT_TIME_RECALCULATING_MILLIS +import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS +import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS import com.soywiz.klock.TimeSpan import io.ktor.client.features.ClientRequestException import io.ktor.client.statement.readText diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/Header.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/Header.kt similarity index 95% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/Header.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/models/Header.kt index 53ad52f..2c2bae5 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/Header.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/Header.kt @@ -1,6 +1,6 @@ -package com.insanusmokrassar.SauceNaoAPI.models +package dev.inmo.saucenaoapi.models -import com.insanusmokrassar.SauceNaoAPI.defaultSauceNaoParser +import dev.inmo.saucenaoapi.defaultSauceNaoParser import kotlinx.serialization.* import kotlinx.serialization.builtins.serializer import kotlinx.serialization.descriptors.SerialDescriptor diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/HeaderIndex.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/HeaderIndex.kt similarity index 80% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/HeaderIndex.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/models/HeaderIndex.kt index 359dac9..05e4771 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/HeaderIndex.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/HeaderIndex.kt @@ -1,4 +1,4 @@ -package com.insanusmokrassar.SauceNaoAPI.models +package dev.inmo.saucenaoapi.models import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/LimitsState.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/LimitsState.kt similarity index 80% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/LimitsState.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/models/LimitsState.kt index ffe6e7a..156f28c 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/LimitsState.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/LimitsState.kt @@ -1,4 +1,4 @@ -package com.insanusmokrassar.SauceNaoAPI.models +package dev.inmo.saucenaoapi.models import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/Result.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/Result.kt similarity index 73% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/Result.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/models/Result.kt index 5444b55..0457a19 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/Result.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/Result.kt @@ -1,4 +1,4 @@ -package com.insanusmokrassar.SauceNaoAPI.models +package dev.inmo.saucenaoapi.models import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/ResultData.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/ResultData.kt similarity index 98% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/ResultData.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/models/ResultData.kt index c247923..74cb01f 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/ResultData.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/ResultData.kt @@ -1,6 +1,6 @@ -package com.insanusmokrassar.SauceNaoAPI.models +package dev.inmo.saucenaoapi.models -import com.insanusmokrassar.SauceNaoAPI.utils.CommonMultivariantStringSerializer +import dev.inmo.saucenaoapi.utils.CommonMultivariantStringSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/ResultHeader.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/ResultHeader.kt similarity index 85% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/ResultHeader.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/models/ResultHeader.kt index 85c664f..dfd49b5 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/ResultHeader.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/ResultHeader.kt @@ -1,4 +1,4 @@ -package com.insanusmokrassar.SauceNaoAPI.models +package dev.inmo.saucenaoapi.models import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/SauceNaoAnswer.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/SauceNaoAnswer.kt similarity index 94% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/SauceNaoAnswer.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/models/SauceNaoAnswer.kt index dd24d8d..a065703 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/models/SauceNaoAnswer.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/models/SauceNaoAnswer.kt @@ -1,6 +1,6 @@ -package com.insanusmokrassar.SauceNaoAPI.models +package dev.inmo.saucenaoapi.models -import com.insanusmokrassar.SauceNaoAPI.defaultSauceNaoParser +import dev.inmo.saucenaoapi.defaultSauceNaoParser import kotlinx.serialization.* import kotlinx.serialization.builtins.ListSerializer import kotlinx.serialization.encoding.Decoder diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/CommonMultivariantStringSerializer.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/CommonMultivariantStringSerializer.kt similarity index 87% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/CommonMultivariantStringSerializer.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/CommonMultivariantStringSerializer.kt index 5f8265b..293454b 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/CommonMultivariantStringSerializer.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/CommonMultivariantStringSerializer.kt @@ -1,8 +1,7 @@ -package com.insanusmokrassar.SauceNaoAPI.utils +package dev.inmo.saucenaoapi.utils import kotlinx.serialization.KSerializer import kotlinx.serialization.Serializer -import kotlinx.serialization.builtins.ListSerializer import kotlinx.serialization.builtins.serializer import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.json.* diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/RequestQuotaManager.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/RequestQuotaManager.kt similarity index 85% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/RequestQuotaManager.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/RequestQuotaManager.kt index 4542f9b..8144b2d 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/RequestQuotaManager.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/RequestQuotaManager.kt @@ -1,11 +1,11 @@ -package com.insanusmokrassar.SauceNaoAPI.utils +package dev.inmo.saucenaoapi.utils -import com.insanusmokrassar.SauceNaoAPI.additional.LONG_TIME_RECALCULATING_MILLIS -import com.insanusmokrassar.SauceNaoAPI.additional.SHORT_TIME_RECALCULATING_MILLIS -import com.insanusmokrassar.SauceNaoAPI.exceptions.TooManyRequestsException -import com.insanusmokrassar.SauceNaoAPI.exceptions.TooManyRequestsLongException -import com.insanusmokrassar.SauceNaoAPI.models.Header -import com.insanusmokrassar.SauceNaoAPI.models.LimitsState +import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS +import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS +import dev.inmo.saucenaoapi.exceptions.TooManyRequestsException +import dev.inmo.saucenaoapi.exceptions.TooManyRequestsLongException +import dev.inmo.saucenaoapi.models.Header +import dev.inmo.saucenaoapi.models.LimitsState import com.soywiz.klock.DateTime import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/SauceCloseable.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/SauceCloseable.kt similarity index 88% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/SauceCloseable.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/SauceCloseable.kt index 87791fa..4070f66 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/SauceCloseable.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/SauceCloseable.kt @@ -1,4 +1,4 @@ -package com.insanusmokrassar.SauceNaoAPI.utils +package dev.inmo.saucenaoapi.utils import kotlinx.coroutines.supervisorScope diff --git a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/TimeManager.kt b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/TimeManager.kt similarity index 93% rename from src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/TimeManager.kt rename to src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/TimeManager.kt index c6a7a48..0526c6f 100644 --- a/src/commonMain/kotlin/com/insanusmokrassar/SauceNaoAPI/utils/TimeManager.kt +++ b/src/commonMain/kotlin/dev/inmo/saucenaoapi/utils/TimeManager.kt @@ -1,7 +1,7 @@ -package com.insanusmokrassar.SauceNaoAPI.utils +package dev.inmo.saucenaoapi.utils -import com.insanusmokrassar.SauceNaoAPI.additional.LONG_TIME_RECALCULATING_MILLIS -import com.insanusmokrassar.SauceNaoAPI.additional.SHORT_TIME_RECALCULATING_MILLIS +import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS +import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS import com.soywiz.klock.DateTime import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.Channel diff --git a/src/jvmTest/kotlin/Launcher.kt b/src/jvmTest/kotlin/Launcher.kt index 5fef72f..43a5d47 100644 --- a/src/jvmTest/kotlin/Launcher.kt +++ b/src/jvmTest/kotlin/Launcher.kt @@ -1,5 +1,5 @@ -import com.insanusmokrassar.SauceNaoAPI.SauceNaoAPI -import com.insanusmokrassar.SauceNaoAPI.utils.useSafe +import dev.inmo.saucenaoapi.SauceNaoAPI +import dev.inmo.saucenaoapi.utils.useSafe import io.ktor.http.ContentType import io.ktor.utils.io.streams.asInput import kotlinx.coroutines.*