diff --git a/build.gradle b/build.gradle index 25ea3d17..b839f789 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,9 @@ buildscript { classpath gradlePlugins.kotlin classpath gradlePlugins.ktlintGradle classpath gradlePlugins.detekt - classpath gradlePlugins.jacocoAndroid + classpath(gradlePlugins.jacocoAndroid) { + exclude group: 'org.codehaus.groovy', module: 'groovy-all' + } } } @@ -27,6 +29,7 @@ allprojects { repositories { jcenter() + google() } } diff --git a/cache/src/main/kotlin/org/moire/ultrasonic/cache/PermanentFileStorage.kt b/cache/src/main/kotlin/org/moire/ultrasonic/cache/PermanentFileStorage.kt index dbfa9658..767e23eb 100644 --- a/cache/src/main/kotlin/org/moire/ultrasonic/cache/PermanentFileStorage.kt +++ b/cache/src/main/kotlin/org/moire/ultrasonic/cache/PermanentFileStorage.kt @@ -19,9 +19,9 @@ internal const val STORAGE_DIR_NAME = "persistent_storage" * Look at [org.moire.ultrasonic.cache.serializers] package for available [DomainEntitySerializer]s. */ class PermanentFileStorage( - private val directories: Directories, - private val serverId: String, - private val debug: Boolean = false + private val directories: Directories, + private val serverId: String, + private val debug: Boolean = false ) { private val serializationContext = object : SerializationContext { override fun isDebug(): Boolean = debug @@ -34,9 +34,9 @@ class PermanentFileStorage( * Stores given [objectToStore] using [name] as a key and [objectSerializer] as serializer. */ fun store( - name: String, - objectToStore: T, - objectSerializer: DomainEntitySerializer + name: String, + objectToStore: T, + objectSerializer: DomainEntitySerializer ) { val storeFile = getFile(name) if (!storeFile.exists()) storeFile.createNewFile() @@ -47,8 +47,8 @@ class PermanentFileStorage( * Loads object with [name] key using [objectDeserializer] deserializer. */ fun load( - name: String, - objectDeserializer: DomainEntitySerializer + name: String, + objectDeserializer: DomainEntitySerializer ): T? { val storeFile = getFile(name) if (!storeFile.exists()) return null diff --git a/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/ArtistSerializer.kt b/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/ArtistSerializer.kt index 751a97d5..d7bd217a 100644 --- a/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/ArtistSerializer.kt +++ b/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/ArtistSerializer.kt @@ -15,9 +15,9 @@ private const val SERIALIZER_VERSION = 1 private val artistSerializer get() = object : ObjectSerializer(SERIALIZER_VERSION) { override fun serializeObject( - context: SerializationContext, - output: SerializerOutput>, - item: Artist + context: SerializationContext, + output: SerializerOutput>, + item: Artist ) { output.writeString(item.id) .writeString(item.name) @@ -31,9 +31,9 @@ private val artistSerializer get() = object : ObjectSerializer(SERIALIZE } override fun deserializeObject( - context: SerializationContext, - input: SerializerInput, - versionNumber: Int + context: SerializationContext, + input: SerializerInput, + versionNumber: Int ): Artist? { if (versionNumber != SERIALIZER_VERSION) return null diff --git a/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/IndexesSerializer.kt b/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/IndexesSerializer.kt index c237be76..8a04f021 100644 --- a/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/IndexesSerializer.kt +++ b/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/IndexesSerializer.kt @@ -14,9 +14,9 @@ private const val SERIALIZATION_VERSION = 1 private val indexesSerializer get() = object : ObjectSerializer(SERIALIZATION_VERSION) { override fun serializeObject( - context: SerializationContext, - output: SerializerOutput>, - item: Indexes + context: SerializationContext, + output: SerializerOutput>, + item: Indexes ) { val artistListSerializer = getArtistListSerializer() output.writeLong(item.lastModified) @@ -26,9 +26,9 @@ private val indexesSerializer get() = object : ObjectSerializer(SERIALI } override fun deserializeObject( - context: SerializationContext, - input: SerializerInput, - versionNumber: Int + context: SerializationContext, + input: SerializerInput, + versionNumber: Int ): Indexes? { if (versionNumber != SERIALIZATION_VERSION) return null diff --git a/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/MusicFolderSerializer.kt b/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/MusicFolderSerializer.kt index c65fabad..1bba19ec 100644 --- a/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/MusicFolderSerializer.kt +++ b/cache/src/main/kotlin/org/moire/ultrasonic/cache/serializers/MusicFolderSerializer.kt @@ -15,17 +15,17 @@ private const val SERIALIZATION_VERSION = 1 private val musicFolderSerializer = object : ObjectSerializer(SERIALIZATION_VERSION) { override fun serializeObject( - context: SerializationContext, - output: SerializerOutput>, - item: MusicFolder + context: SerializationContext, + output: SerializerOutput>, + item: MusicFolder ) { output.writeString(item.id).writeString(item.name) } override fun deserializeObject( - context: SerializationContext, - input: SerializerInput, - versionNumber: Int + context: SerializationContext, + input: SerializerInput, + versionNumber: Int ): MusicFolder? { if (versionNumber != SERIALIZATION_VERSION) return null diff --git a/cache/src/test/kotlin/org/moire/ultrasonic/cache/PermanentFileStorageTest.kt b/cache/src/test/kotlin/org/moire/ultrasonic/cache/PermanentFileStorageTest.kt index bd84b528..c78034fc 100644 --- a/cache/src/test/kotlin/org/moire/ultrasonic/cache/PermanentFileStorageTest.kt +++ b/cache/src/test/kotlin/org/moire/ultrasonic/cache/PermanentFileStorageTest.kt @@ -1,7 +1,7 @@ package org.moire.ultrasonic.cache +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should contain` -import org.amshove.kluent.`should equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.cache.serializers.getMusicFolderSerializer @@ -20,8 +20,8 @@ class PermanentFileStorageTest : BaseStorageTest() { val item = MusicFolder("1", "2") storage.store("test", item, getMusicFolderSerializer()) - storageDir.exists() `should equal to` true - getServerStorageDir().exists() `should equal to` true + storageDir.exists() `should be equal to` true + getServerStorageDir().exists() `should be equal to` true } @Test @@ -32,7 +32,7 @@ class PermanentFileStorageTest : BaseStorageTest() { storage.store(name, item, getMusicFolderSerializer()) val storageFiles = getServerStorageDir().listFiles() - storageFiles.size `should equal to` 1 + storageFiles.size `should be equal to` 1 storageFiles[0].name `should contain` name } @@ -67,7 +67,7 @@ class PermanentFileStorageTest : BaseStorageTest() { storage.clearAll() - getServerStorageDir().listFiles().size `should equal to` 0 + getServerStorageDir().listFiles().size `should be equal to` 0 } @Test diff --git a/dependencies.gradle b/dependencies.gradle index d53fc384..69b58c79 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,33 +1,33 @@ ext.versions = [ - versionCode : 66, - versionName : "2.3.1", + versionCode : 67, + versionName : "2.4.0", minSdk : 14, targetSdk : 22, compileSdk : 27, gradle : '4.5.1', - androidTools : "3.0.1", - ktlint : "0.15.1", - ktlintGradle : "3.0.1", - detekt : "1.0.0.RC6-3", + androidTools : "3.1.0", + ktlint : "0.20.0", + ktlintGradle : "3.2.0", + detekt : "1.0.0.RC6-4", jacoco : "0.7.9", jacocoAndroid : "0.1.2", androidSupport : "22.2.1", - kotlin : "1.2.21", + kotlin : "1.2.31", - retrofit : "2.1.0", + retrofit : "2.4.0", jackson : "2.9.0", - okhttp : "3.9.0", + okhttp : "3.10.0", semver : "1.0.0", twitterSerial : "0.1.6", junit : "4.12", - mockito : "2.12.0", + mockito : "2.16.0", mockitoKotlin : "1.5.0", - kluent : "1.26", + kluent : "1.35", apacheCodecs : "1.10", ] diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Artist.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Artist.kt index dd46d415..9da865e5 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Artist.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Artist.kt @@ -3,12 +3,12 @@ package org.moire.ultrasonic.domain import java.io.Serializable data class Artist( - var id: String? = null, - var name: String? = null, - var index: String? = null, - var coverArt: String? = null, - var albumCount: Long? = null, - var closeness: Int = 0 + var id: String? = null, + var name: String? = null, + var index: String? = null, + var coverArt: String? = null, + var albumCount: Long? = null, + var closeness: Int = 0 ) : Serializable { companion object { private const val serialVersionUID = -5790532593784846982L diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Bookmark.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Bookmark.kt index 4e3458db..09329e4d 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Bookmark.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Bookmark.kt @@ -6,12 +6,12 @@ import java.io.Serializable import java.util.Date data class Bookmark( - val position: Int = 0, - val username: String, - val comment: String, - val created: Date? = null, - val changed: Date? = null, - val entry: Entry + val position: Int = 0, + val username: String, + val comment: String, + val created: Date? = null, + val changed: Date? = null, + val entry: Entry ) : Serializable { companion object { private const val serialVersionUID = 8988990025189807803L diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/ChatMessage.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/ChatMessage.kt index 35e112e2..94af0542 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/ChatMessage.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/ChatMessage.kt @@ -3,9 +3,9 @@ package org.moire.ultrasonic.domain import java.io.Serializable data class ChatMessage( - val username: String, - val time: Long, - val message: String + val username: String, + val time: Long, + val message: String ) : Serializable { companion object { private const val serialVersionUID = 496544310289324167L diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Genre.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Genre.kt index c975d437..e80ed2b2 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Genre.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Genre.kt @@ -3,8 +3,8 @@ package org.moire.ultrasonic.domain import java.io.Serializable data class Genre( - val name: String, - val index: String + val name: String, + val index: String ) : Serializable { companion object { private const val serialVersionUID = -3943025175219134028L diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Indexes.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Indexes.kt index 48711c2d..3d5ef194 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Indexes.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Indexes.kt @@ -3,10 +3,10 @@ package org.moire.ultrasonic.domain import java.io.Serializable data class Indexes( - val lastModified: Long, - val ignoredArticles: String, - val shortcuts: MutableList = mutableListOf(), - val artists: MutableList = mutableListOf() + val lastModified: Long, + val ignoredArticles: String, + val shortcuts: MutableList = mutableListOf(), + val artists: MutableList = mutableListOf() ) : Serializable { companion object { private const val serialVersionUID = 8156117238598414701L diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/JukeboxStatus.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/JukeboxStatus.kt index 67b0e8b5..fb99d5ac 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/JukeboxStatus.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/JukeboxStatus.kt @@ -1,8 +1,8 @@ package org.moire.ultrasonic.domain data class JukeboxStatus( - var positionSeconds: Int? = null, - var currentPlayingIndex: Int? = null, - var gain: Float? = null, - var isPlaying: Boolean = false + var positionSeconds: Int? = null, + var currentPlayingIndex: Int? = null, + var gain: Float? = null, + var isPlaying: Boolean = false ) diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Lyrics.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Lyrics.kt index 6c4315f1..7692d7ef 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Lyrics.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Lyrics.kt @@ -4,7 +4,7 @@ package org.moire.ultrasonic.domain * Song lyrics. */ data class Lyrics( - val artist: String? = null, - val title: String? = null, - val text: String? = null + val artist: String? = null, + val title: String? = null, + val text: String? = null ) diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicDirectory.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicDirectory.kt index 6a647026..7475c701 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicDirectory.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicDirectory.kt @@ -25,8 +25,9 @@ class MusicDirectory { @JvmOverloads fun getChildren( - includeDirs: Boolean = true, - includeFiles: Boolean = true): List { + includeDirs: Boolean = true, + includeFiles: Boolean = true + ): List { if (includeDirs && includeFiles) { return children } @@ -35,34 +36,34 @@ class MusicDirectory { } data class Entry( - var id: String? = null, - var parent: String? = null, - var isDirectory: Boolean = false, - var title: String? = null, - var album: String? = null, - var albumId: String? = null, - var artist: String? = null, - var artistId: String? = null, - var track: Int? = 0, - var year: Int? = 0, - var genre: String? = null, - var contentType: String? = null, - var suffix: String? = null, - var transcodedContentType: String? = null, - var transcodedSuffix: String? = null, - var coverArt: String? = null, - var size: Long? = null, - var songCount: Long? = null, - var duration: Int? = null, - var bitRate: Int? = null, - var path: String? = null, - var isVideo: Boolean = false, - var starred: Boolean = false, - var discNumber: Int? = null, - var type: String? = null, - var created: Date? = null, - var closeness: Int = 0, - var bookmarkPosition: Int = 0 + var id: String? = null, + var parent: String? = null, + var isDirectory: Boolean = false, + var title: String? = null, + var album: String? = null, + var albumId: String? = null, + var artist: String? = null, + var artistId: String? = null, + var track: Int? = 0, + var year: Int? = 0, + var genre: String? = null, + var contentType: String? = null, + var suffix: String? = null, + var transcodedContentType: String? = null, + var transcodedSuffix: String? = null, + var coverArt: String? = null, + var size: Long? = null, + var songCount: Long? = null, + var duration: Int? = null, + var bitRate: Int? = null, + var path: String? = null, + var isVideo: Boolean = false, + var starred: Boolean = false, + var discNumber: Int? = null, + var type: String? = null, + var created: Date? = null, + var closeness: Int = 0, + var bookmarkPosition: Int = 0 ) : Serializable { fun setDuration(duration: Long) { this.duration = duration.toInt() diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicFolder.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicFolder.kt index a7e91d27..9a62688b 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicFolder.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/MusicFolder.kt @@ -4,6 +4,6 @@ package org.moire.ultrasonic.domain * Represents a top level directory in which music or other media is stored. */ data class MusicFolder( - val id: String, - val name: String + val id: String, + val name: String ) diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Playlist.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Playlist.kt index 4f8f7925..aed96150 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Playlist.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Playlist.kt @@ -3,13 +3,13 @@ package org.moire.ultrasonic.domain import java.io.Serializable data class Playlist @JvmOverloads constructor( - val id: String, - var name: String, - val owner: String = "", - val comment: String = "", - val songCount: String = "", - val created: String = "", - val public: Boolean? = null + val id: String, + var name: String, + val owner: String = "", + val comment: String = "", + val songCount: String = "", + val created: String = "", + val public: Boolean? = null ) : Serializable { companion object { private const val serialVersionUID = -4160515427075433798L diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/PodcastsChannel.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/PodcastsChannel.kt index 3b6ae96e..9f5ce4c2 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/PodcastsChannel.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/PodcastsChannel.kt @@ -3,11 +3,11 @@ package org.moire.ultrasonic.domain import java.io.Serializable data class PodcastsChannel( - val id: String, - val title: String?, - val url: String?, - val description: String?, - val status: String? + val id: String, + val title: String?, + val url: String?, + val description: String?, + val status: String? ) : Serializable { companion object { private const val serialVersionUID = -4160515427075433798L diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchCriteria.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchCriteria.kt index 336db68d..72f47d45 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchCriteria.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchCriteria.kt @@ -4,8 +4,8 @@ package org.moire.ultrasonic.domain * The criteria for a music search. */ data class SearchCriteria( - val query: String, - val artistCount: Int, - val albumCount: Int, - val songCount: Int + val query: String, + val artistCount: Int, + val albumCount: Int, + val songCount: Int ) diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchResult.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchResult.kt index 738ccfc6..82479b70 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchResult.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/SearchResult.kt @@ -6,7 +6,7 @@ import org.moire.ultrasonic.domain.MusicDirectory.Entry * The result of a search. Contains matching artists, albums and songs. */ data class SearchResult( - val artists: List, - val albums: List, - val songs: List + val artists: List, + val albums: List, + val songs: List ) diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Share.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Share.kt index 896cdb32..fc8d9c72 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Share.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Share.kt @@ -4,15 +4,15 @@ import org.moire.ultrasonic.domain.MusicDirectory.Entry import java.io.Serializable data class Share( - var id: String? = null, - var url: String? = null, - var description: String? = null, - var username: String? = null, - var created: String? = null, - var lastVisited: String? = null, - var expires: String? = null, - var visitCount: Long? = null, - private val entries: MutableList = mutableListOf() + var id: String? = null, + var url: String? = null, + var description: String? = null, + var username: String? = null, + var created: String? = null, + var lastVisited: String? = null, + var expires: String? = null, + var visitCount: Long? = null, + private val entries: MutableList = mutableListOf() ) : Serializable { val name: String? get() = url?.let { urlPattern.matcher(url).replaceFirst("$1") } diff --git a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Version.kt b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Version.kt index 26fabbcd..30827cf1 100644 --- a/domain/src/main/kotlin/org/moire/ultrasonic/domain/Version.kt +++ b/domain/src/main/kotlin/org/moire/ultrasonic/domain/Version.kt @@ -6,7 +6,7 @@ import net.swiftzer.semver.SemVer * Represents the version number of the Subsonic Android app. */ data class Version( - val version: SemVer + val version: SemVer ) : Comparable { override fun compareTo(other: Version): Int { diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/CommonFunctions.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/CommonFunctions.kt index 7ee3bcc4..d4130355 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/CommonFunctions.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/CommonFunctions.kt @@ -57,18 +57,20 @@ fun parseDate(dateAsString: String): Calendar { return result } -fun checkErrorCallParsed(mockWebServerRule: MockWebServerRule, - apiRequest: () -> Response): T { +fun checkErrorCallParsed( + mockWebServerRule: MockWebServerRule, + apiRequest: () -> Response +): T { mockWebServerRule.enqueueResponse("request_data_not_found_error_response.json") val response = apiRequest() assertResponseSuccessful(response) - with(response.body()) { + with(response.body()!!) { status `should be` SubsonicResponse.Status.ERROR error `should be` SubsonicError.RequestedDataWasNotFound } - return response.body() + return response.body()!! } fun SubsonicResponse.assertBaseResponseOk() { @@ -77,9 +79,11 @@ fun SubsonicResponse.assertBaseResponseOk() { error `should be` null } -fun MockWebServerRule.assertRequestParam(responseResourceName: String = "ping_ok.json", - expectedParam: String, - apiRequest: () -> Response) { +fun MockWebServerRule.assertRequestParam( + responseResourceName: String = "ping_ok.json", + expectedParam: String, + apiRequest: () -> Response +) { this.enqueueResponse(responseResourceName) apiRequest() diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/GetStreamUrlTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/GetStreamUrlTest.kt index e1529d3d..063a5cf7 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/GetStreamUrlTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/GetStreamUrlTest.kt @@ -1,7 +1,7 @@ package org.moire.ultrasonic.api.subsonic import okhttp3.mockwebserver.MockResponse -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.junit.Before import org.junit.Rule import org.junit.Test @@ -34,7 +34,7 @@ class GetStreamUrlTest { val streamUrl = client.getStreamUrl(id) - streamUrl `should equal to` expectedUrl + streamUrl `should be equal to` expectedUrl } @Test @@ -43,6 +43,6 @@ class GetStreamUrlTest { val streamUrl = client.getStreamUrl(id) - streamUrl `should equal to` expectedUrl + streamUrl `should be equal to` expectedUrl } } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiCreateShareTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiCreateShareTest.kt index 82f95769..16a9a5d0 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiCreateShareTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiCreateShareTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -26,19 +26,20 @@ class SubsonicApiCreateShareTest : SubsonicAPIClientTest() { val response = client.api.createShare(listOf("some-id")).execute() assertResponseSuccessful(response) - response.body().shares.size `should equal to` 1 - with(response.body().shares[0]) { - id `should equal to` "0" - url `should equal to` "https://subsonic.com/ext/share/awdwo?jwt=eyJhbGciOiJIUzI1NiJ9." + + response.body()!!.shares.size `should be equal to` 1 + with(response.body()!!.shares[0]) { + id `should be equal to` "0" + url `should be equal to` "https://subsonic.com/ext/share/awdwo?jwt=" + + "eyJhbGciOiJIUzI1NiJ9." + "eyJwYXRoIjoiL2V4dC9zaGFyZS9hd2R3byIsImV4cCI6MTU0MTYyNjQzMX0.iy8dkt_ZZc8hJ692" + "UxorHdHWFU2RB-fMCmCA4IJ_dTw" - username `should equal to` "admin" + username `should be equal to` "admin" created `should equal` parseDate("2017-11-07T21:33:51.748Z") expires `should equal` parseDate("2018-11-07T21:33:51.748Z") lastVisited `should equal` parseDate("2018-11-07T21:33:51.748Z") - description `should equal to` "Awesome link!" - visitCount `should equal to` 0 - items.size `should equal to` 1 + description `should be equal to` "Awesome link!" + visitCount `should be equal to` 0 + items.size `should be equal to` 1 items[0] `should equal` MusicDirectoryChild(id = "4212", parent = "4186", isDir = false, title = "Heaven Knows", album = "Going to Hell", artist = "The Pretty Reckless", track = 3, year = 2014, genre = "Hard Rock", coverArt = "4186", size = 9025090, diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiErrorsTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiErrorsTest.kt index 3b8c66f9..947c7c22 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiErrorsTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiErrorsTest.kt @@ -150,7 +150,7 @@ class SubsonicApiErrorsTest : SubsonicAPIClientTest() { } private fun Response.assertError(expectedError: SubsonicError) = - with(body()) { + with(body()!!) { error `should not be` null error `should equal` expectedError } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumList2Test.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumList2Test.kt index 817a9f36..f7c30d23 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumList2Test.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumList2Test.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Album @@ -28,8 +28,8 @@ class SubsonicApiGetAlbumList2Test : SubsonicAPIClientTest() { val response = client.api.getAlbumList2(STARRED).execute() assertResponseSuccessful(response) - with(response.body().albumList) { - this.size `should equal to` 2 + with(response.body()!!.albumList) { + this.size `should be equal to` 2 this[0] `should equal` Album(id = "962", name = "Fury", artist = "Sick Puppies", artistId = "473", coverArt = "al-962", songCount = 13, duration = 2591, created = parseDate("2017-09-02T17:34:51.000Z"), year = 2016, diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumListRequestTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumListRequestTest.kt index eb2ffb6f..25c833ce 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumListRequestTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumListRequestTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.AlbumListType @@ -27,8 +27,8 @@ class SubsonicApiGetAlbumListRequestTest : SubsonicAPIClientTest() { val response = client.api.getAlbumList(BY_GENRE).execute() assertResponseSuccessful(response) - with(response.body().albumList) { - size `should equal to` 2 + with(response.body()!!.albumList) { + size `should be equal to` 2 this[1] `should equal` MusicDirectoryChild(id = "9997", parent = "9996", isDir = true, title = "Endless Forms Most Beautiful", album = "Endless Forms Most Beautiful", artist = "Nightwish", year = 2015, genre = "Symphonic Metal", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumTest.kt index 32793390..ca29ee28 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -38,18 +38,18 @@ class SubsonicApiGetAlbumTest : SubsonicAPIClientTest() { val response = client.api.getAlbum("512").execute() assertResponseSuccessful(response) - with(response.body().album) { - id `should equal to` "618" - name `should equal to` "Black Ice" - artist `should equal to` "AC/DC" - artistId `should equal to` "362" - coverArt `should equal to` "al-618" - songCount `should equal to` 15 - duration `should equal to` 3331 + with(response.body()!!.album) { + id `should be equal to` "618" + name `should be equal to` "Black Ice" + artist `should be equal to` "AC/DC" + artistId `should be equal to` "362" + coverArt `should be equal to` "al-618" + songCount `should be equal to` 15 + duration `should be equal to` 3331 created `should equal` parseDate("2016-10-23T15:31:22.000Z") - year `should equal to` 2008 - genre `should equal to` "Hard Rock" - songList.size `should equal to` 15 + year `should be equal to` 2008 + genre `should be equal to` "Hard Rock" + songList.size `should be equal to` 15 songList[0] `should equal` MusicDirectoryChild(id = "6491", parent = "6475", isDir = false, title = "Rock 'n' Roll Train", album = "Black Ice", artist = "AC/DC", track = 1, year = 2008, genre = "Hard Rock", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistTest.kt index 5904ee6c..86d2b89b 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -38,12 +38,12 @@ class SubsonicApiGetArtistTest : SubsonicAPIClientTest() { val response = client.api.getArtist("100").execute() assertResponseSuccessful(response) - with(response.body().artist) { - id `should equal to` "362" - name `should equal to` "AC/DC" - coverArt `should equal to` "ar-362" - albumCount `should equal to` 2 - albumsList.size `should equal to` 2 + with(response.body()!!.artist) { + id `should be equal to` "362" + name `should be equal to` "AC/DC" + coverArt `should be equal to` "ar-362" + albumCount `should be equal to` 2 + albumsList.size `should be equal to` 2 albumsList[0] `should equal` Album(id = "618", name = "Black Ice", artist = "AC/DC", artistId = "362", coverArt = "al-618", songCount = 15, duration = 3331, created = parseDate("2016-10-23T15:31:22.000Z"), diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistsTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistsTest.kt index 100042c5..c299509f 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistsTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetArtistsTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -29,11 +29,11 @@ class SubsonicApiGetArtistsTest : SubsonicAPIClientTest() { val response = client.api.getArtists(null).execute() assertResponseSuccessful(response) - with(response.body().indexes) { - lastModified `should equal to` 0L - ignoredArticles `should equal to` "The El La Los Las Le Les" + with(response.body()!!.indexes) { + lastModified `should be equal to` 0L + ignoredArticles `should be equal to` "The El La Los Las Le Les" shortcutList `should equal` emptyList() - indexList.size `should equal to` 2 + indexList.size `should be equal to` 2 indexList `should equal` listOf( Index(name = "A", artists = listOf( Artist(id = "362", name = "AC/DC", coverArt = "ar-362", albumCount = 2), diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAvatarTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAvatarTest.kt index 91acfe65..228ff17e 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAvatarTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAvatarTest.kt @@ -1,8 +1,8 @@ package org.moire.ultrasonic.api.subsonic import okhttp3.mockwebserver.MockResponse +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should be` -import org.amshove.kluent.`should equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -19,7 +19,7 @@ class SubsonicApiGetAvatarTest : SubsonicAPIClientTest() { with(response) { stream `should be` null - responseHttpCode `should equal to` 200 + responseHttpCode `should be equal to` 200 apiError `should equal` SubsonicError.RequestedDataWasNotFound } } @@ -33,7 +33,7 @@ class SubsonicApiGetAvatarTest : SubsonicAPIClientTest() { with(response) { stream `should equal` null - responseHttpCode `should equal to` httpErrorCode + responseHttpCode `should be equal to` httpErrorCode apiError `should be` null } } @@ -46,11 +46,11 @@ class SubsonicApiGetAvatarTest : SubsonicAPIClientTest() { val response = client.stream("some") with(response) { - responseHttpCode `should equal to` 200 + responseHttpCode `should be equal to` 200 apiError `should be` null stream `should not be` null val expectedContent = mockWebServerRule.loadJsonResponse("ping_ok.json") - stream!!.bufferedReader().readText() `should equal to` expectedContent + stream!!.bufferedReader().readText() `should be equal to` expectedContent } } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetBookmarksTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetBookmarksTest.kt index a10070ee..c417199f 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetBookmarksTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetBookmarksTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -25,11 +25,11 @@ class SubsonicApiGetBookmarksTest : SubsonicAPIClientTest() { val response = client.api.getBookmarks().execute() assertResponseSuccessful(response) - response.body().bookmarkList.size `should equal to` 1 - with(response.body().bookmarkList[0]) { - position `should equal to` 107914 - username `should equal to` "CaptainEurope" - comment `should equal to` "Look at this" + response.body()!!.bookmarkList.size `should be equal to` 1 + with(response.body()!!.bookmarkList[0]) { + position `should be equal to` 107914 + username `should be equal to` "CaptainEurope" + comment `should be equal to` "Look at this" created `should equal` parseDate("2017-11-18T15:22:22.144Z") changed `should equal` parseDate("2017-11-18T15:22:22.144Z") entry `should equal` MusicDirectoryChild(id = "10349", parent = "10342", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetChatMessagesTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetChatMessagesTest.kt index 910c58a0..34f13791 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetChatMessagesTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetChatMessagesTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.ChatMessage @@ -25,8 +25,8 @@ class SubsonicApiGetChatMessagesTest : SubsonicAPIClientTest() { val response = client.api.getChatMessages().execute() assertResponseSuccessful(response) - with(response.body().chatMessages) { - size `should equal to` 2 + with(response.body()!!.chatMessages) { + size `should be equal to` 2 this[0] `should equal` ChatMessage(username = "sindre", time = 1269771845310, message = "Sindre was here") this[1] `should equal` ChatMessage(username = "ben", time = 1269771842504, diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetCoverArtTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetCoverArtTest.kt index d327e06c..b961c954 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetCoverArtTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetCoverArtTest.kt @@ -1,8 +1,8 @@ package org.moire.ultrasonic.api.subsonic import okhttp3.mockwebserver.MockResponse +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should be` -import org.amshove.kluent.`should equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -19,7 +19,7 @@ class SubsonicApiGetCoverArtTest : SubsonicAPIClientTest() { with(response) { stream `should be` null - responseHttpCode `should equal to` 200 + responseHttpCode `should be equal to` 200 apiError `should equal` SubsonicError.RequestedDataWasNotFound } } @@ -46,11 +46,11 @@ class SubsonicApiGetCoverArtTest : SubsonicAPIClientTest() { val response = client.getCoverArt("some-id") with(response) { - responseHttpCode `should equal to` 200 + responseHttpCode `should be equal to` 200 apiError `should be` null stream `should not be` null val expectedContent = mockWebServerRule.loadJsonResponse("ping_ok.json") - stream!!.bufferedReader().readText() `should equal to` expectedContent + stream!!.bufferedReader().readText() `should be equal to` expectedContent } } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetGenresTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetGenresTest.kt index 1f311f07..b4783cd8 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetGenresTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetGenresTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Genre @@ -25,8 +25,8 @@ class SubsonicApiGetGenresTest : SubsonicAPIClientTest() { val response = client.api.getGenres().execute() assertResponseSuccessful(response) - with(response.body().genresList) { - size `should equal to` 5 + with(response.body()!!.genresList) { + size `should be equal to` 5 this[0] `should equal` Genre(1186, 103, "Rock") this[1] `should equal` Genre(896, 72, "Electronic") this[2] `should equal` Genre(790, 59, "Alternative Rock") diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetIndexesTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetIndexesTest.kt index b9bbc34c..5f1ac659 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetIndexesTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetIndexesTest.kt @@ -18,8 +18,8 @@ class SubsonicApiGetIndexesTest : SubsonicAPIClientTest() { val response = client.api.getIndexes(null, null).execute() assertResponseSuccessful(response) - response.body().indexes `should not be` null - with(response.body().indexes) { + response.body()!!.indexes `should not be` null + with(response.body()!!.indexes) { lastModified `should equal` 1491069027523 ignoredArticles `should equal` "The El La Los Las Le Les" shortcutList `should equal` listOf( diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLicenseTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLicenseTest.kt index 21401094..d0ca9eb8 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLicenseTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLicenseTest.kt @@ -16,7 +16,7 @@ class SubsonicApiGetLicenseTest : SubsonicAPIClientTest() { val response = client.api.getLicense().execute() assertResponseSuccessful(response) - with(response.body()) { + with(response.body()!!) { assertBaseResponseOk() license `should equal` License(valid = true, trialExpires = parseDate("2016-11-23T20:17:15.206Z"), diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLyricsTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLyricsTest.kt index a5d29b57..55bbc121 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLyricsTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetLyricsTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.junit.Test /** @@ -21,10 +21,10 @@ class SubsonicApiGetLyricsTest : SubsonicAPIClientTest() { val response = client.api.getLyrics().execute() assertResponseSuccessful(response) - with(response.body().lyrics) { - artist `should equal to` "Amorphis" - title `should equal to` "Alone" - text `should equal to` "Tear dimmed rememberance\nIn a womb of time\nBreath upon " + + with(response.body()!!.lyrics) { + artist `should be equal to` "Amorphis" + title `should be equal to` "Alone" + text `should be equal to` "Tear dimmed rememberance\nIn a womb of time\nBreath upon " + "me\nPossessed by the" } } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicDirectoryTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicDirectoryTest.kt index 0801e673..2c851a9a 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicDirectoryTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicDirectoryTest.kt @@ -1,7 +1,7 @@ package org.moire.ultrasonic.api.subsonic +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should be` -import org.amshove.kluent.`should equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -40,15 +40,15 @@ class SubsonicApiGetMusicDirectoryTest : SubsonicAPIClientTest() { assertResponseSuccessful(response) - response.body().musicDirectory `should not be` null - with(response.body().musicDirectory) { - id `should equal to` "4836" - parent `should equal to` "300" + response.body()!!.musicDirectory `should not be` null + with(response.body()!!.musicDirectory) { + id `should be equal to` "4836" + parent `should be equal to` "300" name `should equal` "12 Stones" - userRating `should equal to` 5 - averageRating `should equal to` 5.0f + userRating `should be equal to` 5 + averageRating `should be equal to` 5.0f starred `should equal` null - playCount `should equal to` 1 + playCount `should be equal to` 1 childList.size `should be` 2 childList[0] `should equal` MusicDirectoryChild(id = "4844", parent = "4836", isDir = false, title = "Crash", album = "12 Stones", artist = "12 Stones", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicFoldersTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicFoldersTest.kt index c3460aed..0ccfde1d 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicFoldersTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetMusicFoldersTest.kt @@ -15,7 +15,7 @@ class SubsonicApiGetMusicFoldersTest : SubsonicAPIClientTest() { val response = client.api.getMusicFolders().execute() assertResponseSuccessful(response) - with(response.body()) { + with(response.body()!!) { assertBaseResponseOk() musicFolders `should equal` listOf( MusicFolder("0", "Music"), diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistTest.kt index d542d0db..eb541089 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -28,17 +28,17 @@ class SubsonicApiGetPlaylistTest : SubsonicAPIClientTest() { val response = client.api.getPlaylist("4").execute() assertResponseSuccessful(response) - with(response.body().playlist) { - id `should equal to` "0" - name `should equal to` "Aug 27, 2017 11:17 AM" - owner `should equal to` "admin" - public `should equal to` false - songCount `should equal to` 16 - duration `should equal to` 3573 + with(response.body()!!.playlist) { + id `should be equal to` "0" + name `should be equal to` "Aug 27, 2017 11:17 AM" + owner `should be equal to` "admin" + public `should be equal to` false + songCount `should be equal to` 16 + duration `should be equal to` 3573 created `should equal` parseDate("2017-08-27T11:17:26.216Z") changed `should equal` parseDate("2017-08-27T11:17:26.218Z") - coverArt `should equal to` "pl-0" - entriesList.size `should equal to` 2 + coverArt `should be equal to` "pl-0" + entriesList.size `should be equal to` 2 entriesList[1] `should equal` MusicDirectoryChild(id = "4215", parent = "4186", isDir = false, title = "Going to Hell", album = "Going to Hell", artist = "The Pretty Reckless", track = 2, year = 2014, diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistsTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistsTest.kt index f787c37c..0607d3b7 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistsTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPlaylistsTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -27,8 +27,8 @@ class SubsonicApiGetPlaylistsTest : SubsonicAPIClientTest() { val response = client.api.getPlaylists().execute() assertResponseSuccessful(response) - with(response.body().playlists) { - size `should equal to` 1 + with(response.body()!!.playlists) { + size `should be equal to` 1 this[0] `should equal` Playlist(id = "0", name = "Aug 27, 2017 11:17 AM", owner = "admin", public = false, songCount = 16, duration = 3573, comment = "Some comment", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPodcastsTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPodcastsTest.kt index 985425e4..d6c55519 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPodcastsTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetPodcastsTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -27,20 +27,20 @@ class SubsonicApiGetPodcastsTest : SubsonicAPIClientTest() { val response = client.api.getPodcasts().execute() assertResponseSuccessful(response) - val podcastChannelsList = response.body().podcastChannels - podcastChannelsList.size `should equal to` 1 + val podcastChannelsList = response.body()!!.podcastChannels + podcastChannelsList.size `should be equal to` 1 with(podcastChannelsList[0]) { - id `should equal to` "2" - url `should equal to` "http://feeds.codenewbie.org/cnpodcast.xml" - title `should equal to` "CodeNewbie" - description `should equal to` "Stories and interviews from people on their coding " + + id `should be equal to` "2" + url `should be equal to` "http://feeds.codenewbie.org/cnpodcast.xml" + title `should be equal to` "CodeNewbie" + description `should be equal to` "Stories and interviews from people on their coding " + "journey." - coverArt `should equal to` "pod-2" - originalImageUrl `should equal to` "http://codenewbie.blubrry.com/wp-content/uploads/" + - "powerpress/220808.jpg" - status `should equal to` "completed" - errorMessage `should equal to` "" - episodeList.size `should equal to` 10 + coverArt `should be equal to` "pod-2" + originalImageUrl `should be equal to` "http://codenewbie.blubrry.com/wp-content/" + + "uploads/powerpress/220808.jpg" + status `should be equal to` "completed" + errorMessage `should be equal to` "" + episodeList.size `should be equal to` 10 episodeList[0] `should equal` MusicDirectoryChild(id = "148", parent = "9959", isDir = false, title = "S1:EP3 – How to teach yourself computer science (Vaidehi Joshi)", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetRandomSongsTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetRandomSongsTest.kt index 8f06b174..4257b5e1 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetRandomSongsTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetRandomSongsTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -25,8 +25,8 @@ class SubsonicApiGetRandomSongsTest : SubsonicAPIClientTest() { val response = client.api.getRandomSongs().execute() assertResponseSuccessful(response) - with(response.body().songsList) { - size `should equal to` 3 + with(response.body()!!.songsList) { + size `should be equal to` 3 this[1] `should equal` MusicDirectoryChild(id = "3061", parent = "3050", isDir = false, title = "Sure as Hell", album = "Who Are You Now?", artist = "This Providence", track = 1, year = 2009, genre = "Indie Rock", coverArt = "3050", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSharesTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSharesTest.kt index 6da16b43..c7d953d2 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSharesTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSharesTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -25,19 +25,19 @@ class SubsonicApiGetSharesTest : SubsonicAPIClientTest() { val response = client.api.getShares().execute() assertResponseSuccessful(response) - response.body().shares.size `should equal to` 1 - with(response.body().shares[0]) { - id `should equal to` "0" - url `should equal to` "https://subsonic.com/ext/share/awdwo?jwt=eyJhbGciOiJIUzI1" + + response.body()!!.shares.size `should be equal to` 1 + with(response.body()!!.shares[0]) { + id `should be equal to` "0" + url `should be equal to` "https://subsonic.com/ext/share/awdwo?jwt=eyJhbGciOiJIUzI1" + "NiJ9.eyJwYXRoIjoiL2V4dC9zaGFyZS9hd2R3byIsImV4cCI6MTU0MTYyNjQzMX0.iy8dkt_ZZc8" + "hJ692UxorHdHWFU2RB-fMCmCA4IJ_dTw" - username `should equal to` "admin" + username `should be equal to` "admin" created `should equal` parseDate("2017-11-07T21:33:51.748Z") expires `should equal` parseDate("2018-11-07T21:33:51.748Z") lastVisited `should equal` parseDate("2018-11-07T21:33:51.748Z") - visitCount `should equal to` 0 - description `should equal to` "Awesome link!" - items.size `should equal to` 1 + visitCount `should be equal to` 0 + description `should be equal to` "Awesome link!" + items.size `should be equal to` 1 items[0] `should equal` MusicDirectoryChild(id = "4212", parent = "4186", isDir = false, title = "Heaven Knows", album = "Going to Hell", artist = "The Pretty Reckless", track = 3, year = 2014, genre = "Hard Rock", coverArt = "4186", size = 9025090, diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSongsByGenreTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSongsByGenreTest.kt index c344c8b3..c5446e14 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSongsByGenreTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetSongsByGenreTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -25,8 +25,8 @@ class SubsonicApiGetSongsByGenreTest : SubsonicAPIClientTest() { val response = client.api.getSongsByGenre("Trance").execute() assertResponseSuccessful(response) - response.body().songsList.size `should equal to` 2 - with(response.body().songsList) { + response.body()!!.songsList.size `should be equal to` 2 + with(response.body()!!.songsList) { this[0] `should equal` MusicDirectoryChild(id = "575", parent = "576", isDir = false, title = "Time Machine (Vadim Zhukov Remix)", album = "668", artist = "Tasadi", year = 2008, genre = "Trance", size = 22467672, diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarred2Test.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarred2Test.kt index b8409cd0..3b634ca6 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarred2Test.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarred2Test.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Artist @@ -27,9 +27,9 @@ class SubsonicApiGetStarred2Test : SubsonicAPIClientTest() { val response = client.api.getStarred2().execute() assertResponseSuccessful(response) - with(response.body().starred2) { + with(response.body()!!.starred2) { albumList `should equal` emptyList() - artistList.size `should equal to` 1 + artistList.size `should be equal to` 1 artistList[0] `should equal` Artist(id = "364", name = "Parov Stelar", starred = parseDate("2017-08-12T18:32:58.768Z")) songList `should equal` emptyList() diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarredTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarredTest.kt index 3fd5fb9c..30f17cd7 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarredTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetStarredTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Artist @@ -26,9 +26,9 @@ class SubsonicApiGetStarredTest : SubsonicAPIClientTest() { val response = client.api.getStarred().execute() assertResponseSuccessful(response) - with(response.body().starred) { + with(response.body()!!.starred) { albumList `should equal` emptyList() - artistList.size `should equal to` 1 + artistList.size `should be equal to` 1 artistList[0] `should equal` Artist(id = "364", name = "Parov Stelar", starred = parseDate("2017-08-12T18:32:58.768Z")) songList `should equal` emptyList() diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetUserTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetUserTest.kt index 648cbeae..da14d8d2 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetUserTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetUserTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.User @@ -25,24 +25,24 @@ class SubsonicApiGetUserTest : SubsonicAPIClientTest() { val response = client.api.getUser("some").execute() assertResponseSuccessful(response) - with(response.body().user) { - username `should equal to` "GodOfUniverse" - email `should equal to` "some.mail@example.com" - scrobblingEnabled `should equal to` false - adminRole `should equal to` true - settingsRole `should equal to` true - downloadRole `should equal to` true - uploadRole `should equal to` true - playlistRole `should equal to` true - coverArtRole `should equal to` true - commentRole `should equal to` true - podcastRole `should equal to` true - streamRole `should equal to` true - jukeboxRole `should equal to` true - shareRole `should equal to` true - videoConverstionRole `should equal to` false - folderList.size `should equal to` 1 - folderList[0] `should equal to` 0 + with(response.body()!!.user) { + username `should be equal to` "GodOfUniverse" + email `should be equal to` "some.mail@example.com" + scrobblingEnabled `should be equal to` false + adminRole `should be equal to` true + settingsRole `should be equal to` true + downloadRole `should be equal to` true + uploadRole `should be equal to` true + playlistRole `should be equal to` true + coverArtRole `should be equal to` true + commentRole `should be equal to` true + podcastRole `should be equal to` true + streamRole `should be equal to` true + jukeboxRole `should be equal to` true + shareRole `should be equal to` true + videoConverstionRole `should be equal to` false + folderList.size `should be equal to` 1 + folderList[0] `should be equal to` 0 } } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetVideosListTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetVideosListTest.kt index ef3d71ab..dfd6321c 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetVideosListTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetVideosListTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -25,8 +25,8 @@ class SubsonicApiGetVideosListTest : SubsonicAPIClientTest() { val response = client.api.getVideos().execute() assertResponseSuccessful(response) - with(response.body().videosList) { - size `should equal to` 1 + with(response.body()!!.videosList) { + size `should be equal to` 1 this[0] `should equal` MusicDirectoryChild(id = "10402", parent = "10401", isDir = false, title = "MVI_0512", album = "Incoming", size = 21889646, contentType = "video/avi", suffix = "avi", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiJukeboxControlTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiJukeboxControlTest.kt index d072a217..d047a2f7 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiJukeboxControlTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiJukeboxControlTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.JukeboxAction @@ -29,11 +29,11 @@ class SubsonicApiJukeboxControlTest : SubsonicAPIClientTest() { val response = client.api.jukeboxControl(STATUS).execute() assertResponseSuccessful(response) - with(response.body().jukebox) { - currentIndex `should equal to` 94 - playing `should equal to` true - gain `should equal to` 0.32f - position `should equal to` 3 + with(response.body()!!.jukebox) { + currentIndex `should be equal to` 94 + playing `should be equal to` true + gain `should be equal to` 0.32f + position `should be equal to` 3 playlistEntries `should equal` emptyList() } } @@ -45,12 +45,12 @@ class SubsonicApiJukeboxControlTest : SubsonicAPIClientTest() { val response = client.api.jukeboxControl(GET).execute() assertResponseSuccessful(response) - with(response.body().jukebox) { - currentIndex `should equal to` 887 - playing `should equal to` false - gain `should equal to` 0.88f - position `should equal to` 2 - playlistEntries.size `should equal to` 2 + with(response.body()!!.jukebox) { + currentIndex `should be equal to` 887 + playing `should be equal to` false + gain `should be equal to` 0.88f + position `should be equal to` 2 + playlistEntries.size `should be equal to` 2 playlistEntries[1] `should equal` MusicDirectoryChild(id = "4215", parent = "4186", isDir = false, title = "Going to Hell", album = "Going to Hell", artist = "The Pretty Reckless", track = 2, year = 2014, genre = "Hard Rock", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiPingRequestTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiPingRequestTest.kt index b157ef40..055d91fa 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiPingRequestTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiPingRequestTest.kt @@ -13,7 +13,7 @@ class SubsonicApiPingRequestTest : SubsonicAPIClientTest() { val response = client.api.ping().execute() assertResponseSuccessful(response) - with(response.body()) { + with(response.body()!!) { assertBaseResponseOk() } } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSSLTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSSLTest.kt index f67ae2e8..fb43dbc1 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSSLTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSSLTest.kt @@ -37,9 +37,11 @@ class SubsonicApiSSLTest { mockWebServer.shutdown() } - private fun createSSLContext(certificatePemStream: InputStream, - certificatePkcs12Stream: InputStream, - password: String): SSLContext { + private fun createSSLContext( + certificatePemStream: InputStream, + certificatePkcs12Stream: InputStream, + password: String + ): SSLContext { var cert: X509Certificate? = null val trustStore = KeyStore.getInstance(KeyStore.getDefaultType()) trustStore.load(null) diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTest.kt index cd850480..e20ff06f 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -29,10 +29,10 @@ class SubsonicApiSearchTest : SubsonicAPIClientTest() { val response = client.api.search().execute() assertResponseSuccessful(response) - with(response.body().searchResult) { - offset `should equal to` 10 - totalHits `should equal to` 53 - matchList.size `should equal to` 1 + with(response.body()!!.searchResult) { + offset `should be equal to` 10 + totalHits `should be equal to` 53 + matchList.size `should be equal to` 1 matchList[0] `should equal` MusicDirectoryChild(id = "5831", parent = "5766", isDir = false, title = "You'll Be Under My Wheels", album = "Need for Speed Most Wanted", artist = "The Prodigy", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchThreeTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchThreeTest.kt index e9aca121..8b914571 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchThreeTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchThreeTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -30,17 +30,17 @@ class SubsonicApiSearchThreeTest : SubsonicAPIClientTest() { val response = client.api.search3("some-query").execute() assertResponseSuccessful(response) - with(response.body().searchResult) { - artistList.size `should equal to` 1 + with(response.body()!!.searchResult) { + artistList.size `should be equal to` 1 artistList[0] `should equal` Artist(id = "505", name = "The Prodigy", coverArt = "ar-505", albumCount = 5) - albumList.size `should equal to` 1 + albumList.size `should be equal to` 1 albumList[0] `should equal` Album(id = "855", name = "Always Outnumbered, Never Outgunned", artist = "The Prodigy", artistId = "505", coverArt = "al-855", songCount = 12, duration = 3313, created = parseDate("2016-10-23T20:57:27.000Z"), year = 2004, genre = "Electronic") - songList.size `should equal to` 1 + songList.size `should be equal to` 1 songList[0] `should equal` MusicDirectoryChild(id = "5831", parent = "5766", isDir = false, title = "You'll Be Under My Wheels", album = "Need for Speed Most Wanted", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTwoTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTwoTest.kt index e572090f..06c7b773 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTwoTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiSearchTwoTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -29,16 +29,16 @@ class SubsonicApiSearchTwoTest : SubsonicAPIClientTest() { val response = client.api.search2("some-query").execute() assertResponseSuccessful(response) - with(response.body().searchResult) { - artistList.size `should equal to` 1 + with(response.body()!!.searchResult) { + artistList.size `should be equal to` 1 artistList[0] `should equal` Artist(id = "522", name = "The Prodigy") - albumList.size `should equal to` 1 + albumList.size `should be equal to` 1 albumList[0] `should equal` MusicDirectoryChild(id = "8867", parent = "522", isDir = true, title = "Always Outnumbered, Never Outgunned", album = "Always Outnumbered, Never Outgunned", artist = "The Prodigy", year = 2004, genre = "Electronic", coverArt = "8867", playCount = 0, created = parseDate("2016-10-23T20:57:27.000Z")) - songList.size `should equal to` 1 + songList.size `should be equal to` 1 songList[0] `should equal` MusicDirectoryChild(id = "5831", parent = "5766", isDir = false, title = "You'll Be Under My Wheels", album = "Need for Speed Most Wanted", diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStarTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStarTest.kt index 12377e3d..7ed24e26 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStarTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStarTest.kt @@ -15,7 +15,7 @@ class SubsonicApiStarTest : SubsonicAPIClientTest() { val response = client.api.star().execute() assertResponseSuccessful(response) - response.body().status `should be` SubsonicResponse.Status.OK + response.body()?.status `should be` SubsonicResponse.Status.OK } @Test diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStreamTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStreamTest.kt index 730ee8a1..34bcf3c8 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStreamTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiStreamTest.kt @@ -1,8 +1,8 @@ package org.moire.ultrasonic.api.subsonic import okhttp3.mockwebserver.MockResponse +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should be` -import org.amshove.kluent.`should equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not be` import org.junit.Test @@ -19,7 +19,7 @@ class SubsonicApiStreamTest : SubsonicAPIClientTest() { with(response) { stream `should be` null - responseHttpCode `should equal to` 200 + responseHttpCode `should be equal to` 200 apiError `should equal` SubsonicError.RequestedDataWasNotFound } } @@ -33,7 +33,7 @@ class SubsonicApiStreamTest : SubsonicAPIClientTest() { with(response) { stream `should be` null - responseHttpCode `should equal to` httpErrorCode + responseHttpCode `should be equal to` httpErrorCode apiError `should be` null } } @@ -46,11 +46,11 @@ class SubsonicApiStreamTest : SubsonicAPIClientTest() { val response = client.stream("some-id") with(response) { - responseHttpCode `should equal to` 200 + responseHttpCode `should be equal to` 200 apiError `should be` null stream `should not be` null val expectedContent = mockWebServerRule.loadJsonResponse("ping_ok.json") - stream!!.bufferedReader().readText() `should equal to` expectedContent + stream!!.bufferedReader().readText() `should be equal to` expectedContent } } diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiUnstarTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiUnstarTest.kt index a47a120a..26ec548e 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiUnstarTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiUnstarTest.kt @@ -15,7 +15,7 @@ class SubsonicApiUnstarTest : SubsonicAPIClientTest() { val response = client.api.unstar().execute() assertResponseSuccessful(response) - response.body().status `should be` SubsonicResponse.Status.OK + response.body()?.status `should be` SubsonicResponse.Status.OK } @Test diff --git a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/RangeHeaderInterceptorTest.kt b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/RangeHeaderInterceptorTest.kt index e458fc0d..bbfc0b3a 100644 --- a/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/RangeHeaderInterceptorTest.kt +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/RangeHeaderInterceptorTest.kt @@ -2,8 +2,8 @@ package org.moire.ultrasonic.api.subsonic.interceptors import okhttp3.Interceptor import okhttp3.mockwebserver.MockResponse +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should contain` -import org.amshove.kluent.`should equal to` import org.amshove.kluent.`should not contain` import org.junit.Test @@ -27,7 +27,7 @@ class RangeHeaderInterceptorTest : BaseInterceptorTest() { val executedRequest = mockWebServerRule.mockWebServer.takeRequest() executedRequest.headers.names() `should contain` "Range" - executedRequest.headers["Range"]!! `should equal to` "bytes=$offset-" + executedRequest.headers["Range"]!! `should be equal to` "bytes=$offset-" } @Test @@ -54,6 +54,6 @@ class RangeHeaderInterceptorTest : BaseInterceptorTest() { val executedRequest = mockWebServerRule.mockWebServer.takeRequest() executedRequest.headers.names() `should contain` "Range" - executedRequest.headers["Range"]!! `should equal to` "bytes=$offset-" + executedRequest.headers["Range"]!! `should be equal to` "bytes=$offset-" } } diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiNotSupportedException.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiNotSupportedException.kt index fce439a6..a7191a3a 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiNotSupportedException.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiNotSupportedException.kt @@ -7,5 +7,5 @@ import java.io.IOException * by current server api version. */ class ApiNotSupportedException( - serverApiVersion: SubsonicAPIVersions) - : IOException("Server api $serverApiVersion does not support this call") + serverApiVersion: SubsonicAPIVersions +) : IOException("Server api $serverApiVersion does not support this call") diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiVersionCheckWrapper.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiVersionCheckWrapper.kt index 3f7d998d..e2b6c092 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiVersionCheckWrapper.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/ApiVersionCheckWrapper.kt @@ -43,8 +43,9 @@ import retrofit2.Call * for this call. */ internal class ApiVersionCheckWrapper( - val api: SubsonicAPIDefinition, - var currentApiVersion: SubsonicAPIVersions) : SubsonicAPIDefinition by api { + val api: SubsonicAPIDefinition, + var currentApiVersion: SubsonicAPIVersions +) : SubsonicAPIDefinition by api { override fun getArtists(musicFolderId: String?): Call { checkVersion(V1_8_0) return api.getArtists(musicFolderId) @@ -70,26 +71,30 @@ internal class ApiVersionCheckWrapper( return api.getAlbum(id) } - override fun search2(query: String, - artistCount: Int?, - artistOffset: Int?, - albumCount: Int?, - albumOffset: Int?, - songCount: Int?, - musicFolderId: String?): Call { + override fun search2( + query: String, + artistCount: Int?, + artistOffset: Int?, + albumCount: Int?, + albumOffset: Int?, + songCount: Int?, + musicFolderId: String? + ): Call { checkVersion(V1_4_0) checkParamVersion(musicFolderId, V1_12_0) return api.search2(query, artistCount, artistOffset, albumCount, albumOffset, songCount, musicFolderId) } - override fun search3(query: String, - artistCount: Int?, - artistOffset: Int?, - albumCount: Int?, - albumOffset: Int?, - songCount: Int?, - musicFolderId: String?): Call { + override fun search3( + query: String, + artistCount: Int?, + artistOffset: Int?, + albumCount: Int?, + albumOffset: Int?, + songCount: Int?, + musicFolderId: String? + ): Call { checkVersion(V1_8_0) checkParamVersion(musicFolderId, V1_12_0) return api.search3(query, artistCount, artistOffset, albumCount, albumOffset, @@ -101,9 +106,11 @@ internal class ApiVersionCheckWrapper( return api.getPlaylists(username) } - override fun createPlaylist(id: String?, - name: String?, - songIds: List?): Call { + override fun createPlaylist( + id: String?, + name: String?, + songIds: List? + ): Call { checkVersion(V1_2_0) return api.createPlaylist(id, name, songIds) } @@ -113,12 +120,14 @@ internal class ApiVersionCheckWrapper( return api.deletePlaylist(id) } - override fun updatePlaylist(id: String, - name: String?, - comment: String?, - public: Boolean?, - songIdsToAdd: List?, - songIndexesToRemove: List?): Call { + override fun updatePlaylist( + id: String, + name: String?, + comment: String?, + public: Boolean?, + songIdsToAdd: List?, + songIndexesToRemove: List? + ): Call { checkVersion(V1_8_0) return api.updatePlaylist(id, name, comment, public, songIdsToAdd, songIndexesToRemove) } @@ -141,35 +150,41 @@ internal class ApiVersionCheckWrapper( return api.scrobble(id, time, submission) } - override fun getAlbumList(type: AlbumListType, - size: Int?, - offset: Int?, - fromYear: Int?, - toYear: Int?, - genre: String?, - musicFolderId: String?): Call { + override fun getAlbumList( + type: AlbumListType, + size: Int?, + offset: Int?, + fromYear: Int?, + toYear: Int?, + genre: String?, + musicFolderId: String? + ): Call { checkVersion(V1_2_0) checkParamVersion(musicFolderId, V1_11_0) return api.getAlbumList(type, size, offset, fromYear, toYear, genre, musicFolderId) } - override fun getAlbumList2(type: AlbumListType, - size: Int?, - offset: Int?, - fromYear: Int?, - toYear: Int?, - genre: String?, - musicFolderId: String?): Call { + override fun getAlbumList2( + type: AlbumListType, + size: Int?, + offset: Int?, + fromYear: Int?, + toYear: Int?, + genre: String?, + musicFolderId: String? + ): Call { checkVersion(V1_8_0) checkParamVersion(musicFolderId, V1_12_0) return api.getAlbumList2(type, size, offset, fromYear, toYear, genre, musicFolderId) } - override fun getRandomSongs(size: Int?, - genre: String?, - fromYear: Int?, - toYear: Int?, - musicFolderId: String?): Call { + override fun getRandomSongs( + size: Int?, + genre: String?, + fromYear: Int?, + toYear: Int?, + musicFolderId: String? + ): Call { checkVersion(V1_2_0) return api.getRandomSongs(size, genre, fromYear, toYear, musicFolderId) } @@ -186,14 +201,16 @@ internal class ApiVersionCheckWrapper( return api.getStarred2(musicFolderId) } - override fun stream(id: String, - maxBitRate: Int?, - format: String?, - timeOffset: Int?, - videoSize: String?, - estimateContentLength: Boolean?, - converted: Boolean?, - offset: Long?): Call { + override fun stream( + id: String, + maxBitRate: Int?, + format: String?, + timeOffset: Int?, + videoSize: String?, + estimateContentLength: Boolean?, + converted: Boolean?, + offset: Long? + ): Call { checkParamVersion(maxBitRate, V1_2_0) checkParamVersion(format, V1_6_0) checkParamVersion(videoSize, V1_6_0) @@ -203,11 +220,13 @@ internal class ApiVersionCheckWrapper( estimateContentLength, converted) } - override fun jukeboxControl(action: JukeboxAction, - index: Int?, - offset: Int?, - ids: List?, - gain: Float?): Call { + override fun jukeboxControl( + action: JukeboxAction, + index: Int?, + offset: Int?, + ids: List?, + gain: Float? + ): Call { checkVersion(V1_2_0) checkParamVersion(offset, V1_7_0) return api.jukeboxControl(action, index, offset, ids, gain) @@ -218,9 +237,11 @@ internal class ApiVersionCheckWrapper( return api.getShares() } - override fun createShare(idsToShare: List, - description: String?, - expires: Long?): Call { + override fun createShare( + idsToShare: List, + description: String?, + expires: Long? + ): Call { checkVersion(V1_6_0) return api.createShare(idsToShare, description, expires) } @@ -230,9 +251,11 @@ internal class ApiVersionCheckWrapper( return api.deleteShare(id) } - override fun updateShare(id: String, - description: String?, - expires: Long?): Call { + override fun updateShare( + id: String, + description: String?, + expires: Long? + ): Call { checkVersion(V1_6_0) return api.updateShare(id, description, expires) } @@ -242,10 +265,12 @@ internal class ApiVersionCheckWrapper( return api.getGenres() } - override fun getSongsByGenre(genre: String, - count: Int, - offset: Int, - musicFolderId: String?): Call { + override fun getSongsByGenre( + genre: String, + count: Int, + offset: Int, + musicFolderId: String? + ): Call { checkVersion(V1_9_0) checkParamVersion(musicFolderId, V1_12_0) return api.getSongsByGenre(genre, count, offset, musicFolderId) @@ -271,9 +296,11 @@ internal class ApiVersionCheckWrapper( return api.getBookmarks() } - override fun createBookmark(id: String, - position: Long, - comment: String?): Call { + override fun createBookmark( + id: String, + position: Long, + comment: String? + ): Call { checkVersion(V1_9_0) return api.createBookmark(id, position, comment) } diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIClient.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIClient.kt index fa1c1cd2..577e55d2 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIClient.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIClient.kt @@ -35,14 +35,16 @@ private const val READ_TIMEOUT = 60_000L * * @author Yahor Berdnikau */ -class SubsonicAPIClient(baseUrl: String, - username: String, - password: String, - minimalProtocolVersion: SubsonicAPIVersions, - clientID: String, - allowSelfSignedCertificate: Boolean = false, - enableLdapUserSupport: Boolean = false, - debug: Boolean = false) { +class SubsonicAPIClient( + baseUrl: String, + username: String, + password: String, + minimalProtocolVersion: SubsonicAPIVersions, + clientID: String, + allowSelfSignedCertificate: Boolean = false, + enableLdapUserSupport: Boolean = false, + debug: Boolean = false +) { private val versionInterceptor = VersionInterceptor(minimalProtocolVersion) { protocolVersion = it } @@ -139,14 +141,14 @@ class SubsonicAPIClient(baseUrl: String, val response = apiCall() return if (response.isSuccessful) { val responseBody = response.body() - val contentType = responseBody.contentType() + val contentType = responseBody?.contentType() if (contentType != null && contentType.type().equals("application", true) && contentType.subtype().equals("json", true)) { val error = jacksonMapper.readValue(responseBody.byteStream()) StreamResponse(apiError = error.error, responseHttpCode = response.code()) } else { - StreamResponse(stream = responseBody.byteStream(), + StreamResponse(stream = responseBody?.byteStream(), responseHttpCode = response.code()) } } else { @@ -165,7 +167,7 @@ class SubsonicAPIClient(baseUrl: String, val request = api.stream(id).execute() val url = request.raw().request().url().toString() if (request.isSuccessful) { - request.body().close() + request.body()?.close() } return url } diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIDefinition.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIDefinition.kt index e115ccb3..d867d452 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIDefinition.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIDefinition.kt @@ -54,8 +54,10 @@ interface SubsonicAPIDefinition { fun getMusicFolders(): Call @GET("getIndexes.view") - fun getIndexes(@Query("musicFolderId") musicFolderId: String?, - @Query("ifModifiedSince") ifModifiedSince: Long?): Call + fun getIndexes( + @Query("musicFolderId") musicFolderId: String?, + @Query("ifModifiedSince") ifModifiedSince: Long? + ): Call @GET("getMusicDirectory.view") fun getMusicDirectory(@Query("id") id: String): Call @@ -64,14 +66,18 @@ interface SubsonicAPIDefinition { fun getArtists(@Query("musicFolderId") musicFolderId: String?): Call @GET("star.view") - fun star(@Query("id") id: String? = null, - @Query("albumId") albumId: String? = null, - @Query("artistId") artistId: String? = null): Call + fun star( + @Query("id") id: String? = null, + @Query("albumId") albumId: String? = null, + @Query("artistId") artistId: String? = null + ): Call @GET("unstar.view") - fun unstar(@Query("id") id: String? = null, - @Query("albumId") albumId: String? = null, - @Query("artistId") artistId: String? = null): Call + fun unstar( + @Query("id") id: String? = null, + @Query("albumId") albumId: String? = null, + @Query("artistId") artistId: String? = null + ): Call @GET("getArtist.view") fun getArtist(@Query("id") id: String): Call @@ -80,31 +86,37 @@ interface SubsonicAPIDefinition { fun getAlbum(@Query("id") id: String): Call @GET("search.view") - fun search(@Query("artist") artist: String? = null, - @Query("album") album: String? = null, - @Query("title") title: String? = null, - @Query("any") any: String? = null, - @Query("count") count: Int? = null, - @Query("offset") offset: Int? = null, - @Query("newerThan") newerThan: Long? = null): Call + fun search( + @Query("artist") artist: String? = null, + @Query("album") album: String? = null, + @Query("title") title: String? = null, + @Query("any") any: String? = null, + @Query("count") count: Int? = null, + @Query("offset") offset: Int? = null, + @Query("newerThan") newerThan: Long? = null + ): Call @GET("search2.view") - fun search2(@Query("query") query: String, - @Query("artistCount") artistCount: Int? = null, - @Query("artistOffset") artistOffset: Int? = null, - @Query("albumCount") albumCount: Int? = null, - @Query("albumOffset") albumOffset: Int? = null, - @Query("songCount") songCount: Int? = null, - @Query("musicFolderId") musicFolderId: String? = null): Call + fun search2( + @Query("query") query: String, + @Query("artistCount") artistCount: Int? = null, + @Query("artistOffset") artistOffset: Int? = null, + @Query("albumCount") albumCount: Int? = null, + @Query("albumOffset") albumOffset: Int? = null, + @Query("songCount") songCount: Int? = null, + @Query("musicFolderId") musicFolderId: String? = null + ): Call @GET("search3.view") - fun search3(@Query("query") query: String, - @Query("artistCount") artistCount: Int? = null, - @Query("artistOffset") artistOffset: Int? = null, - @Query("albumCount") albumCount: Int? = null, - @Query("albumOffset") albumOffset: Int? = null, - @Query("songCount") songCount: Int? = null, - @Query("musicFolderId") musicFolderId: String? = null): Call + fun search3( + @Query("query") query: String, + @Query("artistCount") artistCount: Int? = null, + @Query("artistOffset") artistOffset: Int? = null, + @Query("albumCount") albumCount: Int? = null, + @Query("albumOffset") albumOffset: Int? = null, + @Query("songCount") songCount: Int? = null, + @Query("musicFolderId") musicFolderId: String? = null + ): Call @GET("getPlaylist.view") fun getPlaylist(@Query("id") id: String): Call @@ -113,119 +125,143 @@ interface SubsonicAPIDefinition { fun getPlaylists(@Query("username") username: String? = null): Call @GET("createPlaylist.view") - fun createPlaylist(@Query("playlistId") id: String? = null, - @Query("name") name: String? = null, - @Query("songId") songIds: List? = null): Call + fun createPlaylist( + @Query("playlistId") id: String? = null, + @Query("name") name: String? = null, + @Query("songId") songIds: List? = null + ): Call @GET("deletePlaylist.view") fun deletePlaylist(@Query("id") id: String): Call @GET("updatePlaylist.view") fun updatePlaylist( - @Query("playlistId") id: String, - @Query("name") name: String? = null, - @Query("comment") comment: String? = null, - @Query("public") public: Boolean? = null, - @Query("songIdToAdd") songIdsToAdd: List? = null, - @Query("songIndexToRemove") songIndexesToRemove: List? = null): + @Query("playlistId") id: String, + @Query("name") name: String? = null, + @Query("comment") comment: String? = null, + @Query("public") public: Boolean? = null, + @Query("songIdToAdd") songIdsToAdd: List? = null, + @Query("songIndexToRemove") songIndexesToRemove: List? = null + ): Call @GET("getPodcasts.view") - fun getPodcasts(@Query("includeEpisodes") includeEpisodes: Boolean? = null, - @Query("id") id: String? = null): Call + fun getPodcasts( + @Query("includeEpisodes") includeEpisodes: Boolean? = null, + @Query("id") id: String? = null + ): Call @GET("getLyrics.view") - fun getLyrics(@Query("artist") artist: String? = null, - @Query("title") title: String? = null): Call + fun getLyrics( + @Query("artist") artist: String? = null, + @Query("title") title: String? = null + ): Call @GET("scrobble.view") - fun scrobble(@Query("id") id: String, - @Query("time") time: Long? = null, - @Query("submission") submission: Boolean? = null): Call + fun scrobble( + @Query("id") id: String, + @Query("time") time: Long? = null, + @Query("submission") submission: Boolean? = null + ): Call @GET("getAlbumList.view") fun getAlbumList( - @Query("type") type: AlbumListType, - @Query("size") size: Int? = null, - @Query("offset") offset: Int? = null, - @Query("fromYear") fromYear: Int? = null, - @Query("toYear") toYear: Int? = null, - @Query("genre") genre: String? = null, - @Query("musicFolderId") musicFolderId: String? = null): Call + @Query("type") type: AlbumListType, + @Query("size") size: Int? = null, + @Query("offset") offset: Int? = null, + @Query("fromYear") fromYear: Int? = null, + @Query("toYear") toYear: Int? = null, + @Query("genre") genre: String? = null, + @Query("musicFolderId") musicFolderId: String? = null + ): Call @GET("getAlbumList2.view") fun getAlbumList2( - @Query("type") type: AlbumListType, - @Query("size") size: Int? = null, - @Query("offset") offset: Int? = null, - @Query("fromYear") fromYear: Int? = null, - @Query("toYear") toYear: Int? = null, - @Query("genre") genre: String? = null, - @Query("musicFolderId") musicFolderId: String? = null): Call + @Query("type") type: AlbumListType, + @Query("size") size: Int? = null, + @Query("offset") offset: Int? = null, + @Query("fromYear") fromYear: Int? = null, + @Query("toYear") toYear: Int? = null, + @Query("genre") genre: String? = null, + @Query("musicFolderId") musicFolderId: String? = null + ): Call @GET("getRandomSongs.view") fun getRandomSongs( - @Query("size") size: Int? = null, - @Query("genre") genre: String? = null, - @Query("fromYear") fromYear: Int? = null, - @Query("toYear") toYear: Int? = null, - @Query("musicFolderId") musicFolderId: String? = null): Call + @Query("size") size: Int? = null, + @Query("genre") genre: String? = null, + @Query("fromYear") fromYear: Int? = null, + @Query("toYear") toYear: Int? = null, + @Query("musicFolderId") musicFolderId: String? = null + ): Call @GET("getStarred.view") fun getStarred(@Query("musicFolderId") musicFolderId: String? = null): Call @GET("getStarred2.view") fun getStarred2( - @Query("musicFolderId") musicFolderId: String? = null): Call + @Query("musicFolderId") musicFolderId: String? = null + ): Call @Streaming @GET("getCoverArt.view") - fun getCoverArt(@Query("id") id: String, - @Query("size") size: Long? = null): Call + fun getCoverArt( + @Query("id") id: String, + @Query("size") size: Long? = null + ): Call @Streaming @GET("stream.view") - fun stream(@Query("id") id: String, - @Query("maxBitRate") maxBitRate: Int? = null, - @Query("format") format: String? = null, - @Query("timeOffset") timeOffset: Int? = null, - @Query("size") videoSize: String? = null, - @Query("estimateContentLength") estimateContentLength: Boolean? = null, - @Query("converted") converted: Boolean? = null, - @Header("Range") offset: Long? = null): Call + fun stream( + @Query("id") id: String, + @Query("maxBitRate") maxBitRate: Int? = null, + @Query("format") format: String? = null, + @Query("timeOffset") timeOffset: Int? = null, + @Query("size") videoSize: String? = null, + @Query("estimateContentLength") estimateContentLength: Boolean? = null, + @Query("converted") converted: Boolean? = null, + @Header("Range") offset: Long? = null + ): Call @GET("jukeboxControl.view") - fun jukeboxControl(@Query("action") action: JukeboxAction, - @Query("index") index: Int? = null, - @Query("offset") offset: Int? = null, - @Query("id") ids: List? = null, - @Query("gain") gain: Float? = null): Call + fun jukeboxControl( + @Query("action") action: JukeboxAction, + @Query("index") index: Int? = null, + @Query("offset") offset: Int? = null, + @Query("id") ids: List? = null, + @Query("gain") gain: Float? = null + ): Call @GET("getShares.view") fun getShares(): Call @GET("createShare.view") - fun createShare(@Query("id") idsToShare: List, - @Query("description") description: String? = null, - @Query("expires") expires: Long? = null): Call + fun createShare( + @Query("id") idsToShare: List, + @Query("description") description: String? = null, + @Query("expires") expires: Long? = null + ): Call @GET("deleteShare.view") fun deleteShare(@Query("id") id: String): Call @GET("updateShare.view") - fun updateShare(@Query("id") id: String, - @Query("description") description: String? = null, - @Query("expires") expires: Long? = null): Call + fun updateShare( + @Query("id") id: String, + @Query("description") description: String? = null, + @Query("expires") expires: Long? = null + ): Call @GET("getGenres.view") fun getGenres(): Call @GET("getSongsByGenre.view") fun getSongsByGenre( - @Query("genre") genre: String, - @Query("count") count: Int = 10, - @Query("offset") offset: Int = 0, - @Query("musicFolderId") musicFolderId: String? = null): Call + @Query("genre") genre: String, + @Query("count") count: Int = 10, + @Query("offset") offset: Int = 0, + @Query("musicFolderId") musicFolderId: String? = null + ): Call @GET("getUser.view") fun getUser(@Query("username") username: String): Call @@ -241,9 +277,10 @@ interface SubsonicAPIDefinition { @GET("createBookmark.view") fun createBookmark( - @Query("id") id: String, - @Query("position") position: Long, - @Query("comment") comment: String? = null): Call + @Query("id") id: String, + @Query("position") position: Long, + @Query("comment") comment: String? = null + ): Call @GET("deleteBookmark.view") fun deleteBookmark(@Query("id") id: String): Call diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIVersions.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIVersions.kt index 2d82ef29..042346d1 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIVersions.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicAPIVersions.kt @@ -56,8 +56,10 @@ enum class SubsonicAPIVersions(val subsonicVersions: String, val restApiVersion: } class SubsonicAPIVersionsDeserializer : JsonDeserializer() { - override fun deserialize(p: JsonParser, - ctxt: DeserializationContext?): SubsonicAPIVersions { + override fun deserialize( + p: JsonParser, + ctxt: DeserializationContext? + ): SubsonicAPIVersions { if (p.currentName != "version") { throw JsonParseException(p, "Not valid token for API version!") } diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/PasswordHexInterceptor.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/PasswordHexInterceptor.kt index bec49519..a6c8b853 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/PasswordHexInterceptor.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/PasswordHexInterceptor.kt @@ -19,7 +19,7 @@ class PasswordHexInterceptor(private val password: String) : Interceptor { override fun intercept(chain: Chain): Response { val originalRequest = chain.request() val updatedUrl = originalRequest.url().newBuilder() - .addQueryParameter("p", passwordHex).build() + .addEncodedQueryParameter("p", passwordHex).build() return chain.proceed(originalRequest.newBuilder().url(updatedUrl).build()) } } diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/ProxyPasswordInterceptor.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/ProxyPasswordInterceptor.kt index ca796a17..d05e7516 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/ProxyPasswordInterceptor.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/ProxyPasswordInterceptor.kt @@ -12,10 +12,10 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions * ldap users. */ internal class ProxyPasswordInterceptor( - initialAPIVersions: SubsonicAPIVersions, - private val hexInterceptor: PasswordHexInterceptor, - private val mD5Interceptor: PasswordMD5Interceptor, - private val forceHexPassword: Boolean = false + initialAPIVersions: SubsonicAPIVersions, + private val hexInterceptor: PasswordHexInterceptor, + private val mD5Interceptor: PasswordMD5Interceptor, + private val forceHexPassword: Boolean = false ) : Interceptor { var apiVersion: SubsonicAPIVersions = initialAPIVersions diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/VersionInterceptor.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/VersionInterceptor.kt index 223582fa..ae700f5a 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/VersionInterceptor.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/interceptors/VersionInterceptor.kt @@ -20,8 +20,9 @@ private const val DEFAULT_PEEK_BYTE_COUNT = 1000L * @author Yahor Berdnikau */ internal class VersionInterceptor( - internal var protocolVersion: SubsonicAPIVersions, - private val notifier: (SubsonicAPIVersions) -> Unit = {}) : Interceptor { + internal var protocolVersion: SubsonicAPIVersions, + private val notifier: (SubsonicAPIVersions) -> Unit = {} +) : Interceptor { private val jsonFactory = JsonFactory() override fun intercept(chain: Chain): okhttp3.Response { diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Album.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Album.kt index df21c658..5dacd51b 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Album.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Album.kt @@ -4,14 +4,15 @@ import com.fasterxml.jackson.annotation.JsonProperty import java.util.Calendar data class Album( - val id: String = "", - val name: String = "", - val coverArt: String = "", - val artist: String = "", - val artistId: String = "", - val songCount: Int = 0, - val duration: Int = 0, - val created: Calendar? = null, - val year: Int = 0, - val genre: String = "", - @JsonProperty("song") val songList: List = emptyList()) + val id: String = "", + val name: String = "", + val coverArt: String = "", + val artist: String = "", + val artistId: String = "", + val songCount: Int = 0, + val duration: Int = 0, + val created: Calendar? = null, + val year: Int = 0, + val genre: String = "", + @JsonProperty("song") val songList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Artist.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Artist.kt index 709409d5..697dbfaa 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Artist.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Artist.kt @@ -3,10 +3,12 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty import java.util.Calendar -data class Artist(val id: String = "", - val name: String = "", - val coverArt: String = "", - val albumCount: Int = 0, - val starred: Calendar? = null, - @JsonProperty("album") - val albumsList: List = emptyList()) +data class Artist( + val id: String = "", + val name: String = "", + val coverArt: String = "", + val albumCount: Int = 0, + val starred: Calendar? = null, + @JsonProperty("album") + val albumsList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Bookmark.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Bookmark.kt index f527b068..56a5ad7a 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Bookmark.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Bookmark.kt @@ -3,9 +3,10 @@ package org.moire.ultrasonic.api.subsonic.models import java.util.Calendar data class Bookmark( - val position: Long = 0, - val username: String = "", - val comment: String = "", - val created: Calendar? = null, - val changed: Calendar? = null, - val entry: MusicDirectoryChild = MusicDirectoryChild()) + val position: Long = 0, + val username: String = "", + val comment: String = "", + val created: Calendar? = null, + val changed: Calendar? = null, + val entry: MusicDirectoryChild = MusicDirectoryChild() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/ChatMessage.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/ChatMessage.kt index 7e76a466..abf4c010 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/ChatMessage.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/ChatMessage.kt @@ -1,6 +1,7 @@ package org.moire.ultrasonic.api.subsonic.models data class ChatMessage( - val username: String = "", - val time: Long = 0, - val message: String = "") + val username: String = "", + val time: Long = 0, + val message: String = "" +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Genre.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Genre.kt index 6a54d43c..90b73740 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Genre.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Genre.kt @@ -2,6 +2,8 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty -data class Genre(val songCount: Int = 0, - val albumCount: Int = 0, - @JsonProperty("value") val name: String) +data class Genre( + val songCount: Int = 0, + val albumCount: Int = 0, + @JsonProperty("value") val name: String +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Index.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Index.kt index 9d25ce4b..eb454f7f 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Index.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Index.kt @@ -2,6 +2,8 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty -data class Index(val name: String = "", - @JsonProperty("artist") - val artists: List = emptyList()) +data class Index( + val name: String = "", + @JsonProperty("artist") + val artists: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Indexes.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Indexes.kt index bd46cea4..74a5390d 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Indexes.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Indexes.kt @@ -2,9 +2,11 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty -data class Indexes(val lastModified: Long = 0, - val ignoredArticles: String = "", - @JsonProperty("index") - val indexList: List = emptyList(), - @JsonProperty("shortcut") - val shortcutList: List = emptyList()) +data class Indexes( + val lastModified: Long = 0, + val ignoredArticles: String = "", + @JsonProperty("index") + val indexList: List = emptyList(), + @JsonProperty("shortcut") + val shortcutList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/JukeboxStatus.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/JukeboxStatus.kt index c52fc1cf..063cb22f 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/JukeboxStatus.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/JukeboxStatus.kt @@ -3,8 +3,9 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty data class JukeboxStatus( - val currentIndex: Int = -1, - val playing: Boolean = false, - val gain: Float = 0.0f, - val position: Int = 0, - @JsonProperty("entry") val playlistEntries: List = emptyList()) + val currentIndex: Int = -1, + val playing: Boolean = false, + val gain: Float = 0.0f, + val position: Int = 0, + @JsonProperty("entry") val playlistEntries: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/License.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/License.kt index efe819d4..a83d6543 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/License.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/License.kt @@ -3,7 +3,8 @@ package org.moire.ultrasonic.api.subsonic.models import java.util.Calendar data class License( - val valid: Boolean = false, - val email: String = "", - val trialExpires: Calendar = Calendar.getInstance(), - val licenseExpires: Calendar = Calendar.getInstance()) + val valid: Boolean = false, + val email: String = "", + val trialExpires: Calendar = Calendar.getInstance(), + val licenseExpires: Calendar = Calendar.getInstance() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Lyrics.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Lyrics.kt index 830104b0..5845cf38 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Lyrics.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Lyrics.kt @@ -3,6 +3,7 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty data class Lyrics( - val artist: String = "", - val title: String = "", - @JsonProperty("value") val text: String = "") + val artist: String = "", + val title: String = "", + @JsonProperty("value") val text: String = "" +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectory.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectory.kt index 6d445097..0c69832f 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectory.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectory.kt @@ -3,12 +3,14 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty import java.util.Calendar -data class MusicDirectory(val id: String = "", - val parent: String = "", - val name: String = "", - val userRating: Int = 0, - val averageRating: Float = 0.0f, - val starred: Calendar? = null, - val playCount: Int = 0, - @JsonProperty("child") - val childList: List = emptyList()) +data class MusicDirectory( + val id: String = "", + val parent: String = "", + val name: String = "", + val userRating: Int = 0, + val averageRating: Float = 0.0f, + val starred: Calendar? = null, + val playCount: Int = 0, + @JsonProperty("child") + val childList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectoryChild.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectoryChild.kt index 28440d82..d51b39ca 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectoryChild.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/MusicDirectoryChild.kt @@ -2,36 +2,38 @@ package org.moire.ultrasonic.api.subsonic.models import java.util.Calendar -data class MusicDirectoryChild(val id: String = "", - val parent: String = "", - val isDir: Boolean = false, - val title: String = "", - val album: String = "", - val artist: String = "", - val track: Int = -1, - val year: Int? = null, - val genre: String = "", - val coverArt: String = "", - val size: Long = -1, - val contentType: String = "", - val suffix: String = "", - val transcodedContentType: String = "", - val transcodedSuffix: String = "", - val duration: Int = -1, - val bitRate: Int = -1, - val path: String = "", - val isVideo: Boolean = false, - val playCount: Int = 0, - val discNumber: Int = -1, - val created: Calendar? = null, - val albumId: String = "", - val artistId: String = "", - val type: String = "", - val starred: Calendar? = null, - val streamId: String = "", - val channelId: String = "", - val description: String = "", - val status: String = "", - val publishDate: Calendar? = null, - val userRating: Int? = null, - val averageRating: Float? = null) +data class MusicDirectoryChild( + val id: String = "", + val parent: String = "", + val isDir: Boolean = false, + val title: String = "", + val album: String = "", + val artist: String = "", + val track: Int = -1, + val year: Int? = null, + val genre: String = "", + val coverArt: String = "", + val size: Long = -1, + val contentType: String = "", + val suffix: String = "", + val transcodedContentType: String = "", + val transcodedSuffix: String = "", + val duration: Int = -1, + val bitRate: Int = -1, + val path: String = "", + val isVideo: Boolean = false, + val playCount: Int = 0, + val discNumber: Int = -1, + val created: Calendar? = null, + val albumId: String = "", + val artistId: String = "", + val type: String = "", + val starred: Calendar? = null, + val streamId: String = "", + val channelId: String = "", + val description: String = "", + val status: String = "", + val publishDate: Calendar? = null, + val userRating: Int? = null, + val averageRating: Float? = null +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Playlist.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Playlist.kt index ce3c41be..ccc83a69 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Playlist.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Playlist.kt @@ -4,15 +4,15 @@ import com.fasterxml.jackson.annotation.JsonProperty import java.util.Calendar data class Playlist( - val id: String = "", - val name: String = "", - val owner: String = "", - val comment: String = "", - val public: Boolean = false, - val songCount: Int = 0, - val duration: Long = 0, - val created: Calendar? = null, - val changed: Calendar? = null, - val coverArt: String = "", - @JsonProperty("entry") val entriesList: List = emptyList() + val id: String = "", + val name: String = "", + val owner: String = "", + val comment: String = "", + val public: Boolean = false, + val songCount: Int = 0, + val duration: Long = 0, + val created: Calendar? = null, + val changed: Calendar? = null, + val coverArt: String = "", + @JsonProperty("entry") val entriesList: List = emptyList() ) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/PodcastChannel.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/PodcastChannel.kt index d2a44b83..cb46e59f 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/PodcastChannel.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/PodcastChannel.kt @@ -3,12 +3,13 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty data class PodcastChannel( - val id: String = "", - val url: String = "", - val title: String = "", - val description: String = "", - val coverArt: String = "", - val originalImageUrl: String = "", - val status: String = "", - val errorMessage: String = "", - @JsonProperty("episode") val episodeList: List = emptyList()) + val id: String = "", + val url: String = "", + val title: String = "", + val description: String = "", + val coverArt: String = "", + val originalImageUrl: String = "", + val status: String = "", + val errorMessage: String = "", + @JsonProperty("episode") val episodeList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchResult.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchResult.kt index 1efade9a..d26f9cfa 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchResult.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchResult.kt @@ -3,6 +3,7 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty data class SearchResult( - val offset: Int = 0, - val totalHits: Int = 0, - @JsonProperty("match") val matchList: List = emptyList()) + val offset: Int = 0, + val totalHits: Int = 0, + @JsonProperty("match") val matchList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchThreeResult.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchThreeResult.kt index c6c3a626..14c35353 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchThreeResult.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchThreeResult.kt @@ -3,7 +3,7 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty data class SearchThreeResult( - @JsonProperty("artist") val artistList: List = emptyList(), - @JsonProperty("album") val albumList: List = emptyList(), - @JsonProperty("song") val songList: List = emptyList() + @JsonProperty("artist") val artistList: List = emptyList(), + @JsonProperty("album") val albumList: List = emptyList(), + @JsonProperty("song") val songList: List = emptyList() ) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchTwoResult.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchTwoResult.kt index 4a0fbb92..1b42f640 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchTwoResult.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/SearchTwoResult.kt @@ -3,7 +3,7 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty data class SearchTwoResult( - @JsonProperty("artist") val artistList: List = emptyList(), - @JsonProperty("album") val albumList: List = emptyList(), - @JsonProperty("song") val songList: List = emptyList() + @JsonProperty("artist") val artistList: List = emptyList(), + @JsonProperty("album") val albumList: List = emptyList(), + @JsonProperty("song") val songList: List = emptyList() ) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Share.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Share.kt index b28c480f..765540c3 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Share.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/Share.kt @@ -4,12 +4,13 @@ import com.fasterxml.jackson.annotation.JsonProperty import java.util.Calendar data class Share( - val id: String = "", - val url: String = "", - val username: String = "", - val created: Calendar? = null, - val expires: Calendar? = null, - val visitCount: Int = 0, - val description: String = "", - val lastVisited: Calendar? = null, - @JsonProperty("entry") val items: List = emptyList()) + val id: String = "", + val url: String = "", + val username: String = "", + val created: Calendar? = null, + val expires: Calendar? = null, + val visitCount: Int = 0, + val description: String = "", + val lastVisited: Calendar? = null, + @JsonProperty("entry") val items: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/User.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/User.kt index 792f2556..f8ce3d70 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/User.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/models/User.kt @@ -3,19 +3,20 @@ package org.moire.ultrasonic.api.subsonic.models import com.fasterxml.jackson.annotation.JsonProperty data class User( - val username: String = "", - val email: String = "", - val scrobblingEnabled: Boolean = false, - val adminRole: Boolean = false, - val settingsRole: Boolean = false, - val downloadRole: Boolean = false, - val uploadRole: Boolean = false, - val playlistRole: Boolean = false, - val coverArtRole: Boolean = false, - val commentRole: Boolean = false, - val podcastRole: Boolean = false, - val streamRole: Boolean = false, - val jukeboxRole: Boolean = false, - val shareRole: Boolean = false, - val videoConverstionRole: Boolean = false, - @JsonProperty("folder") val folderList: List = emptyList()) + val username: String = "", + val email: String = "", + val scrobblingEnabled: Boolean = false, + val adminRole: Boolean = false, + val settingsRole: Boolean = false, + val downloadRole: Boolean = false, + val uploadRole: Boolean = false, + val playlistRole: Boolean = false, + val coverArtRole: Boolean = false, + val commentRole: Boolean = false, + val podcastRole: Boolean = false, + val streamRole: Boolean = false, + val jukeboxRole: Boolean = false, + val shareRole: Boolean = false, + val videoConverstionRole: Boolean = false, + @JsonProperty("folder") val folderList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/BookmarksResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/BookmarksResponse.kt index 4eaae226..5cbd8bbd 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/BookmarksResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/BookmarksResponse.kt @@ -6,13 +6,15 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Bookmark class BookmarksResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : SubsonicResponse(status, version, error) { + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("bookmarks") private val bookmarksWrapper = BookmarkWrapper() val bookmarkList: List get() = bookmarksWrapper.bookmarkList } internal class BookmarkWrapper( - @JsonProperty("bookmark") val bookmarkList: List = emptyList()) + @JsonProperty("bookmark") val bookmarkList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/ChatMessagesResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/ChatMessagesResponse.kt index 4e41ccc8..71055616 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/ChatMessagesResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/ChatMessagesResponse.kt @@ -6,13 +6,15 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.ChatMessage class ChatMessagesResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : SubsonicResponse(status, version, error) { + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("chatMessages") private val wrapper = ChatMessagesWrapper() val chatMessages: List get() = wrapper.messagesList } internal class ChatMessagesWrapper( - @JsonProperty("chatMessage") val messagesList: List = emptyList()) + @JsonProperty("chatMessage") val messagesList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GenresResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GenresResponse.kt index fdf34c18..85fbb35c 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GenresResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GenresResponse.kt @@ -5,9 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Genre -class GenresResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : SubsonicResponse(status, version, error) { +class GenresResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("genres") private val genresWrapper = GenresWrapper() val genresList: List get() = genresWrapper.genresList } diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumList2Response.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumList2Response.kt index cf16d95e..264ba727 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumList2Response.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumList2Response.kt @@ -6,10 +6,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Album @Suppress("NamingConventionViolation") -class GetAlbumList2Response(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) - : SubsonicResponse(status, version, error) { +class GetAlbumList2Response( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("albumList2") private val albumWrapper2 = AlbumWrapper2() val albumList: List @@ -18,4 +19,5 @@ class GetAlbumList2Response(status: Status, @Suppress("NamingConventionViolation") private class AlbumWrapper2( - @JsonProperty("album") val albumList: List = emptyList()) + @JsonProperty("album") val albumList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumListResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumListResponse.kt index 44e1cccf..8e3ca708 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumListResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumListResponse.kt @@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild -class GetAlbumListResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) - : SubsonicResponse(status, version, error) { +class GetAlbumListResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("albumList") private val albumWrapper = AlbumWrapper() val albumList: List @@ -16,4 +17,5 @@ class GetAlbumListResponse(status: Status, } private class AlbumWrapper( - @JsonProperty("album") val albumList: List = emptyList()) + @JsonProperty("album") val albumList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumResponse.kt index a5f07596..59dd315a 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumResponse.kt @@ -4,7 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Album -class GetAlbumResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val album: Album = Album()) : SubsonicResponse(status, version, error) +class GetAlbumResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val album: Album = Album() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistResponse.kt index 45b4e1f2..122073b2 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistResponse.kt @@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Artist -class GetArtistResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val artist: Artist = Artist()) - : SubsonicResponse(status, version, error) +class GetArtistResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val artist: Artist = Artist() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistsResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistsResponse.kt index 76337483..586d0c81 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistsResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetArtistsResponse.kt @@ -5,8 +5,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Indexes -class GetArtistsResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - @JsonProperty("artists") val indexes: Indexes = Indexes()) : - SubsonicResponse(status, version, error) +class GetArtistsResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + @JsonProperty("artists") val indexes: Indexes = Indexes() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetIndexesResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetIndexesResponse.kt index c5f5bb7e..cbd64e17 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetIndexesResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetIndexesResponse.kt @@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Indexes -class GetIndexesResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val indexes: Indexes = Indexes()) : - SubsonicResponse(status, version, error) +class GetIndexesResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val indexes: Indexes = Indexes() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetLyricsResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetLyricsResponse.kt index a2fe0a0a..d10a5de7 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetLyricsResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetLyricsResponse.kt @@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Lyrics -class GetLyricsResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val lyrics: Lyrics = Lyrics()) - : SubsonicResponse(status, version, error) +class GetLyricsResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val lyrics: Lyrics = Lyrics() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetMusicDirectoryResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetMusicDirectoryResponse.kt index d5ca3e0c..3a468440 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetMusicDirectoryResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetMusicDirectoryResponse.kt @@ -5,9 +5,10 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.MusicDirectory -class GetMusicDirectoryResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - @JsonProperty("directory") - val musicDirectory: MusicDirectory = MusicDirectory()) : - SubsonicResponse(status, version, error) +class GetMusicDirectoryResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + @JsonProperty("directory") + val musicDirectory: MusicDirectory = MusicDirectory() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistResponse.kt index 522761e0..7846d50b 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistResponse.kt @@ -5,7 +5,8 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Playlist class GetPlaylistResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val playlist: Playlist = Playlist()) : SubsonicResponse(status, version, error) + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val playlist: Playlist = Playlist() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistsResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistsResponse.kt index a07c610d..84a32b20 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistsResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPlaylistsResponse.kt @@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Playlist -class GetPlaylistsResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) - : SubsonicResponse(status, version, error) { +class GetPlaylistsResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("playlists") private val playlistsWrapper: PlaylistsWrapper = PlaylistsWrapper() @@ -17,4 +18,5 @@ class GetPlaylistsResponse(status: Status, } private class PlaylistsWrapper( - @JsonProperty("playlist") val playlistList: List = emptyList()) + @JsonProperty("playlist") val playlistList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPodcastsResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPodcastsResponse.kt index 00286413..3fa0fd1d 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPodcastsResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetPodcastsResponse.kt @@ -6,9 +6,10 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.PodcastChannel class GetPodcastsResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : SubsonicResponse(status, version, error) { + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("podcasts") private val channelsWrapper = PodcastChannelWrapper() val podcastChannels: List @@ -16,4 +17,5 @@ class GetPodcastsResponse( } private class PodcastChannelWrapper( - @JsonProperty("channel") val channelsList: List = emptyList()) + @JsonProperty("channel") val channelsList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetRandomSongsResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetRandomSongsResponse.kt index 603e7744..c987db12 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetRandomSongsResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetRandomSongsResponse.kt @@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild -class GetRandomSongsResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) - : SubsonicResponse(status, version, error) { +class GetRandomSongsResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("randomSongs") private val songsWrapper = RandomSongsWrapper() val songsList @@ -16,4 +17,5 @@ class GetRandomSongsResponse(status: Status, } private class RandomSongsWrapper( - @JsonProperty("song") val songsList: List = emptyList()) + @JsonProperty("song") val songsList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetSongsByGenreResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetSongsByGenreResponse.kt index e5247cfa..61b8274f 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetSongsByGenreResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetSongsByGenreResponse.kt @@ -6,13 +6,15 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild class GetSongsByGenreResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : SubsonicResponse(status, version, error) { + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("songsByGenre") private val songsByGenreList = SongsByGenreWrapper() val songsList get() = songsByGenreList.songsList } internal class SongsByGenreWrapper( - @JsonProperty("song") val songsList: List = emptyList()) + @JsonProperty("song") val songsList: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredResponse.kt index dc4e59eb..0c8b50a3 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredResponse.kt @@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.SearchTwoResult -class GetStarredResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val starred: SearchTwoResult = SearchTwoResult()) - : SubsonicResponse(status, version, error) +class GetStarredResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val starred: SearchTwoResult = SearchTwoResult() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredTwoResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredTwoResponse.kt index cbbeafcc..3a25ad67 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredTwoResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetStarredTwoResponse.kt @@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.SearchTwoResult -class GetStarredTwoResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val starred2: SearchTwoResult = SearchTwoResult()) - : SubsonicResponse(status, version, error) +class GetStarredTwoResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val starred2: SearchTwoResult = SearchTwoResult() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetUserResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetUserResponse.kt index 31934af4..25a3891a 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetUserResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetUserResponse.kt @@ -5,7 +5,8 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.User class GetUserResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val user: User = User()) : SubsonicResponse(status, version, error) + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val user: User = User() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/JukeboxResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/JukeboxResponse.kt index be2d6f74..eb936ef5 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/JukeboxResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/JukeboxResponse.kt @@ -5,11 +5,12 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.JukeboxStatus -class JukeboxResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - var jukebox: JukeboxStatus = JukeboxStatus()) - : SubsonicResponse(status, version, error) { +class JukeboxResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + var jukebox: JukeboxStatus = JukeboxStatus() +) : SubsonicResponse(status, version, error) { @JsonSetter("jukeboxStatus") fun setJukeboxStatus(jukebox: JukeboxStatus) { this.jukebox = jukebox } diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/LicenseResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/LicenseResponse.kt index f5b7567b..35206a0b 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/LicenseResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/LicenseResponse.kt @@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.License -class LicenseResponse(val license: License = License(), - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : - SubsonicResponse(status, version, error) +class LicenseResponse( + val license: License = License(), + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/MusicFoldersResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/MusicFoldersResponse.kt index 8e78c0d7..1cd6edcc 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/MusicFoldersResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/MusicFoldersResponse.kt @@ -5,14 +5,16 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.MusicFolder -class MusicFoldersResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : - SubsonicResponse(status, version, error) { +class MusicFoldersResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("musicFolders") private val wrapper = MusicFoldersWrapper() val musicFolders get() = wrapper.musicFolders } internal class MusicFoldersWrapper( - @JsonProperty("musicFolder") val musicFolders: List = emptyList()) + @JsonProperty("musicFolder") val musicFolders: List = emptyList() +) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchResponse.kt index aac0a817..11cc14e6 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchResponse.kt @@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.SearchResult -class SearchResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - val searchResult: SearchResult = SearchResult()) - : SubsonicResponse(status, version, error) +class SearchResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + val searchResult: SearchResult = SearchResult() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchThreeResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchThreeResponse.kt index 32cd4ae0..3c9f45b3 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchThreeResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchThreeResponse.kt @@ -6,8 +6,8 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.SearchThreeResult class SearchThreeResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - @JsonProperty("searchResult3") val searchResult: SearchThreeResult = SearchThreeResult()) - : SubsonicResponse(status, version, error) + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + @JsonProperty("searchResult3") val searchResult: SearchThreeResult = SearchThreeResult() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchTwoResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchTwoResponse.kt index b1a97164..863b7820 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchTwoResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SearchTwoResponse.kt @@ -6,8 +6,8 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.SearchTwoResult class SearchTwoResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?, - @JsonProperty("searchResult2") val searchResult: SearchTwoResult = SearchTwoResult()) - : SubsonicResponse(status, version, error) + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError?, + @JsonProperty("searchResult2") val searchResult: SearchTwoResult = SearchTwoResult() +) : SubsonicResponse(status, version, error) diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SharesResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SharesResponse.kt index c3d4fb0a..a57d8b23 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SharesResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SharesResponse.kt @@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.Share -class SharesResponse(status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) - : SubsonicResponse(status, version, error) { +class SharesResponse( + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("shares") private val wrappedShares = SharesWrapper() val shares get() = wrappedShares.share diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponse.kt index 7af5547b..7f4e7f26 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponse.kt @@ -9,9 +9,11 @@ import java.io.InputStream * * [responseHttpCode] will be there always. */ -class StreamResponse(val stream: InputStream? = null, - val apiError: SubsonicError? = null, - val responseHttpCode: Int) { +class StreamResponse( + val stream: InputStream? = null, + val apiError: SubsonicError? = null, + val responseHttpCode: Int +) { /** * Check if this response has error. */ diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SubsonicResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SubsonicResponse.kt index 55156217..92c234b8 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SubsonicResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/SubsonicResponse.kt @@ -13,9 +13,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError * Base Subsonic API response. */ @JsonRootName(value = "subsonic-response") -open class SubsonicResponse(val status: Status, - val version: SubsonicAPIVersions, - val error: SubsonicError?) { +open class SubsonicResponse( + val status: Status, + val version: SubsonicAPIVersions, + val error: SubsonicError? +) { @JsonDeserialize(using = Status.Companion.StatusJsonDeserializer::class) enum class Status(val jsonValue: String) { OK("ok"), ERROR("failed"); diff --git a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/VideosResponse.kt b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/VideosResponse.kt index 9ac4ff11..e6f8d0eb 100644 --- a/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/VideosResponse.kt +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/VideosResponse.kt @@ -6,13 +6,15 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild class VideosResponse( - status: Status, - version: SubsonicAPIVersions, - error: SubsonicError?) : SubsonicResponse(status, version, error) { + status: Status, + version: SubsonicAPIVersions, + error: SubsonicError? +) : SubsonicResponse(status, version, error) { @JsonProperty("videos") private val videosWrapper = VideosWrapper() val videosList: List get() = videosWrapper.videosList } internal class VideosWrapper( - @JsonProperty("video") val videosList: List = emptyList()) + @JsonProperty("video") val videosList: List = emptyList() +) diff --git a/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/models/AlbumListTypeTest.kt b/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/models/AlbumListTypeTest.kt index ef0948d7..b072d646 100644 --- a/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/models/AlbumListTypeTest.kt +++ b/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/models/AlbumListTypeTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic.models -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should throw` import org.junit.Test @@ -36,6 +36,6 @@ class AlbumListTypeTest { @Test fun `Should return type name for toString call`() { - AlbumListType.STARRED.typeName `should equal to` AlbumListType.STARRED.toString() + AlbumListType.STARRED.typeName `should be equal to` AlbumListType.STARRED.toString() } } diff --git a/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponseTest.kt b/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponseTest.kt index ee3c0253..f09bf7d5 100644 --- a/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponseTest.kt +++ b/subsonic-api/src/test/kotlin/org/moire/ultrasonic/api/subsonic/response/StreamResponseTest.kt @@ -1,6 +1,6 @@ package org.moire.ultrasonic.api.subsonic.response -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.junit.Test import org.moire.ultrasonic.api.subsonic.SubsonicError.RequestedDataWasNotFound @@ -11,26 +11,26 @@ class StreamResponseTest { @Test fun `Should have error if subsonic error is not null`() { StreamResponse(apiError = RequestedDataWasNotFound, responseHttpCode = 200) - .hasError() `should equal to` true + .hasError() `should be equal to` true } @Test fun `Should have error if http error is greater then 300`() { - StreamResponse(responseHttpCode = 301).hasError() `should equal to` true + StreamResponse(responseHttpCode = 301).hasError() `should be equal to` true } @Test fun `Should have error of http error code is lower then 200`() { - StreamResponse(responseHttpCode = 199).hasError() `should equal to` true + StreamResponse(responseHttpCode = 199).hasError() `should be equal to` true } @Test fun `Should not have error if http code is 200`() { - StreamResponse(responseHttpCode = 200).hasError() `should equal to` false + StreamResponse(responseHttpCode = 200).hasError() `should be equal to` false } @Test fun `Should not have error if http code is 300`() { - StreamResponse(responseHttpCode = 300).hasError() `should equal to` false + StreamResponse(responseHttpCode = 300).hasError() `should be equal to` false } } diff --git a/ultrasonic/src/main/AndroidManifest.xml b/ultrasonic/src/main/AndroidManifest.xml index c0c48bfc..6c158318 100644 --- a/ultrasonic/src/main/AndroidManifest.xml +++ b/ultrasonic/src/main/AndroidManifest.xml @@ -20,7 +20,8 @@ + + + + + + diff --git a/ultrasonic/src/main/res/drawable/ic_launcher_foreground.xml b/ultrasonic/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..202ba2b0 --- /dev/null +++ b/ultrasonic/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,10 @@ + + + + diff --git a/ultrasonic/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ultrasonic/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..bbd3e021 --- /dev/null +++ b/ultrasonic/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ultrasonic/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ultrasonic/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..bbd3e021 --- /dev/null +++ b/ultrasonic/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ultrasonic/src/main/res/mipmap-hdpi/ic_launcher.png b/ultrasonic/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..c5d13007 Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/ultrasonic/src/main/res/mipmap-hdpi/ic_launcher_round.png b/ultrasonic/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..14f0810c Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/ultrasonic/src/main/res/mipmap-mdpi/ic_launcher.png b/ultrasonic/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..42a18c46 Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/ultrasonic/src/main/res/mipmap-mdpi/ic_launcher_round.png b/ultrasonic/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..1b04252e Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/ultrasonic/src/main/res/mipmap-xhdpi/ic_launcher.png b/ultrasonic/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..dc8eb47a Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/ultrasonic/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/ultrasonic/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..5f663df0 Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/ultrasonic/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ultrasonic/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d4230eb Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/ultrasonic/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/ultrasonic/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..6f0f94eb Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/ultrasonic/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/ultrasonic/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..cb11421e Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/ultrasonic/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/ultrasonic/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..5af1f877 Binary files /dev/null and b/ultrasonic/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIAlbumConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIAlbumConverterTest.kt index 64adb575..222b05b9 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIAlbumConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIAlbumConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Album @@ -47,7 +47,7 @@ class APIAlbumConverterTest { with(convertedEntity) { name `should equal` null - getChildren().size `should equal to` entity.songList.size + getChildren().size `should be equal to` entity.songList.size getChildren()[0] `should equal` entity.songList[0].toDomainEntity() } } @@ -59,7 +59,7 @@ class APIAlbumConverterTest { val convertedList = entityList.toDomainEntityList() with(convertedList) { - size `should equal to` entityList.size + size `should be equal to` entityList.size forEachIndexed { index, entry -> entry `should equal` entityList[index].toDomainEntity() } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIBookmarkConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIBookmarkConverterTest.kt index 9de472da..7fea260b 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIBookmarkConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIBookmarkConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Bookmark @@ -21,7 +21,7 @@ class APIBookmarkConverterTest { val domainEntity = entity.toDomainEntity() with(domainEntity) { - position `should equal to` entity.position.toInt() + position `should be equal to` entity.position.toInt() username `should equal` entity.username comment `should equal` entity.comment created `should equal` entity.created?.time @@ -36,7 +36,7 @@ class APIBookmarkConverterTest { val domainEntitiesList = entitiesList.toDomainEntitiesList() - domainEntitiesList.size `should equal to` entitiesList.size + domainEntitiesList.size `should be equal to` entitiesList.size domainEntitiesList.forEachIndexed({ index, bookmark -> bookmark `should equal` entitiesList[index].toDomainEntity() }) diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIChatMessageConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIChatMessageConverterTest.kt index ee462a89..3ccb81b7 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIChatMessageConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIChatMessageConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.ChatMessage @@ -31,7 +31,7 @@ class APIChatMessageConverterTest { val domainEntitiesList = entitiesList.toDomainEntitiesList() with(domainEntitiesList) { - size `should equal to` entitiesList.size + size `should be equal to` entitiesList.size forEachIndexed { index, chatMessage -> chatMessage `should equal` entitiesList[index].toDomainEntity() } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIIndexesConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIIndexesConverterTest.kt index d51522a4..9314ad60 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIIndexesConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIIndexesConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Artist @@ -30,9 +30,9 @@ class APIIndexesConverterTest { val expectedArtists = (artistsA + artistsT).map { it.toDomainEntity() }.toMutableList() with(convertedEntity) { - lastModified `should equal to` entity.lastModified - ignoredArticles `should equal to` entity.ignoredArticles - artists.size `should equal to` expectedArtists.size + lastModified `should be equal to` entity.lastModified + ignoredArticles `should be equal to` entity.ignoredArticles + artists.size `should be equal to` expectedArtists.size artists `should equal` expectedArtists shortcuts `should equal` artistsA.map { it.toDomainEntity() }.toMutableList() } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIJukeboxConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIJukeboxConverterTest.kt index d6498860..95755c55 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIJukeboxConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIJukeboxConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.JukeboxStatus @@ -20,7 +20,7 @@ class APIJukeboxConverterTest { with(convertedEntity) { currentPlayingIndex `should equal` entity.currentIndex gain `should equal` entity.gain - isPlaying `should equal to` entity.playing + isPlaying `should be equal to` entity.playing positionSeconds `should equal` entity.position } } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicDirectoryConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicDirectoryConverterTest.kt index 9e8f80c2..3e4a0f1a 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicDirectoryConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicDirectoryConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectory @@ -23,7 +23,7 @@ class APIMusicDirectoryConverterTest { with(convertedEntity) { name `should equal` entity.name - getAllChild().size `should equal to` entity.childList.size + getAllChild().size `should be equal to` entity.childList.size getAllChild() `should equal` entity.childList .map { it.toDomainEntity() }.toMutableList() } @@ -46,7 +46,7 @@ class APIMusicDirectoryConverterTest { with(convertedEntity) { id `should equal` entity.id parent `should equal` entity.parent - isDirectory `should equal to` entity.isDir + isDirectory `should be equal to` entity.isDir title `should equal` entity.title album `should equal` entity.album albumId `should equal` entity.albumId @@ -64,9 +64,9 @@ class APIMusicDirectoryConverterTest { duration `should equal` entity.duration bitRate `should equal` entity.bitRate path `should equal` entity.path - isVideo `should equal to` entity.isVideo + isVideo `should be equal to` entity.isVideo created `should equal` entity.created?.time - starred `should equal to` (entity.starred != null) + starred `should be equal to` (entity.starred != null) discNumber `should equal` entity.discNumber type `should equal` entity.type } @@ -91,7 +91,7 @@ class APIMusicDirectoryConverterTest { val domainList = entitiesList.toDomainEntityList() - domainList.size `should equal to` entitiesList.size + domainList.size `should be equal to` entitiesList.size domainList.forEachIndexed { index, entry -> entry `should equal` entitiesList[index].toDomainEntity() } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicFolderConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicFolderConverterTest.kt index 7c66d464..fdae4ec8 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicFolderConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIMusicFolderConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicFolder @@ -16,8 +16,8 @@ class APIMusicFolderConverterTest { val convertedEntity = entity.toDomainEntity() - convertedEntity.name `should equal to` entity.name - convertedEntity.id `should equal to` entity.id + convertedEntity.name `should be equal to` entity.name + convertedEntity.id `should be equal to` entity.id } @Test @@ -29,11 +29,11 @@ class APIMusicFolderConverterTest { val convertedList = entityList.toDomainEntityList() with(convertedList) { - size `should equal to` entityList.size - this[0].id `should equal to` entityList[0].id - this[0].name `should equal to` entityList[0].name - this[1].id `should equal to` entityList[1].id - this[1].name `should equal to` entityList[1].name + size `should be equal to` entityList.size + this[0].id `should be equal to` entityList[0].id + this[0].name `should be equal to` entityList[0].name + this[1].id `should be equal to` entityList[1].id + this[1].name `should be equal to` entityList[1].name } } } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPlaylistConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPlaylistConverterTest.kt index a99a288b..88897d3f 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPlaylistConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPlaylistConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -24,7 +24,7 @@ class APIPlaylistConverterTest { with(convertedEntity) { name `should equal` entity.name - getAllChild().size `should equal to` entity.entriesList.size + getAllChild().size `should be equal to` entity.entriesList.size getAllChild()[0] `should equal` entity.entriesList[0].toDomainEntity() getAllChild()[1] `should equal` entity.entriesList[1].toDomainEntity() } @@ -40,13 +40,13 @@ class APIPlaylistConverterTest { val convertedEntity = entity.toDomainEntity() with(convertedEntity) { - id `should equal to` entity.id - name `should equal to` entity.name - comment `should equal to` entity.comment - owner `should equal to` entity.owner + id `should be equal to` entity.id + name `should be equal to` entity.name + comment `should be equal to` entity.comment + owner `should be equal to` entity.owner public `should equal` entity.public - songCount `should equal to` entity.songCount.toString() - created `should equal to` playlistDateFormat.format(entity.created?.time) + songCount `should be equal to` entity.songCount.toString() + created `should be equal to` playlistDateFormat.format(entity.created?.time) } } @@ -57,7 +57,7 @@ class APIPlaylistConverterTest { val convertedList = entitiesList.toDomainEntitiesList() with(convertedList) { - size `should equal to` entitiesList.size + size `should be equal to` entitiesList.size this[0] `should equal` entitiesList[0].toDomainEntity() } } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPodcastConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPodcastConverterTest.kt index dcc49b47..46d384b8 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPodcastConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIPodcastConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.PodcastChannel @@ -37,7 +37,7 @@ class APIPodcastConverterTest { val converted = entitiesList.toDomainEntitiesList() with(converted) { - size `should equal to` entitiesList.size + size `should be equal to` entitiesList.size this[0] `should equal` entitiesList[0].toDomainEntity() } } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APISearchConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APISearchConverterTest.kt index 5e3ce2cf..8c69e95e 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APISearchConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APISearchConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.amshove.kluent.`should not equal` import org.junit.Test @@ -27,10 +27,10 @@ class APISearchConverterTest { with(convertedEntity) { albums `should not equal` null - albums.size `should equal to` 0 + albums.size `should be equal to` 0 artists `should not equal` null - artists.size `should equal to` 0 - songs.size `should equal to` entity.matchList.size + artists.size `should be equal to` 0 + songs.size `should be equal to` entity.matchList.size songs[0] `should equal` entity.matchList[0].toDomainEntity() } } @@ -48,11 +48,11 @@ class APISearchConverterTest { val convertedEntity = entity.toDomainEntity() with(convertedEntity) { - artists.size `should equal to` entity.artistList.size + artists.size `should be equal to` entity.artistList.size artists[0] `should equal` entity.artistList[0].toDomainEntity() - albums.size `should equal to` entity.albumList.size + albums.size `should be equal to` entity.albumList.size albums[0] `should equal` entity.albumList[0].toDomainEntity() - songs.size `should equal to` entity.songList.size + songs.size `should be equal to` entity.songList.size songs[0] `should equal` entity.songList[0].toDomainEntity() } } @@ -68,11 +68,11 @@ class APISearchConverterTest { val convertedEntity = entity.toDomainEntity() with(convertedEntity) { - artists.size `should equal to` entity.artistList.size + artists.size `should be equal to` entity.artistList.size artists[0] `should equal` entity.artistList[0].toDomainEntity() - albums.size `should equal to` entity.albumList.size + albums.size `should be equal to` entity.albumList.size albums[0] `should equal` entity.albumList[0].toDomainEntity() - songs.size `should equal to` entity.songList.size + songs.size `should be equal to` entity.songList.size songs[0] `should equal` entity.songList[0].toDomainEntity() } } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIShareConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIShareConverterTest.kt index 623af2f5..53a99962 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIShareConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIShareConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild @@ -47,7 +47,7 @@ class APIShareConverterTest { val domainEntityList = entityList.toDomainEntitiesList() - domainEntityList.size `should equal to` entityList.size + domainEntityList.size `should be equal to` entityList.size domainEntityList[0] `should equal` entityList[0].toDomainEntity() domainEntityList[1] `should equal` entityList[1].toDomainEntity() } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIUserConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIUserConverterTest.kt index 0fdff320..3dfb19a8 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIUserConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APIUserConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.User @@ -19,19 +19,19 @@ class APIUserConverterTest { val domainEntity = entity.toDomainEntity() with(domainEntity) { - adminRole `should equal to` entity.adminRole - commentRole `should equal to` entity.commentRole - coverArtRole `should equal to` entity.coverArtRole - downloadRole `should equal to` entity.downloadRole + adminRole `should be equal to` entity.adminRole + commentRole `should be equal to` entity.commentRole + coverArtRole `should be equal to` entity.coverArtRole + downloadRole `should be equal to` entity.downloadRole email `should equal` entity.email - jukeboxRole `should equal to` entity.jukeboxRole - playlistRole `should equal to` entity.playlistRole - podcastRole `should equal to` entity.podcastRole - scrobblingEnabled `should equal to` entity.scrobblingEnabled - settingsRole `should equal to` entity.settingsRole - shareRole `should equal to` entity.shareRole - streamRole `should equal to` entity.streamRole - uploadRole `should equal to` entity.uploadRole + jukeboxRole `should be equal to` entity.jukeboxRole + playlistRole `should be equal to` entity.playlistRole + podcastRole `should be equal to` entity.podcastRole + scrobblingEnabled `should be equal to` entity.scrobblingEnabled + settingsRole `should be equal to` entity.settingsRole + shareRole `should be equal to` entity.shareRole + streamRole `should be equal to` entity.streamRole + uploadRole `should be equal to` entity.uploadRole userName `should equal` entity.username } } diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/ApiGenreConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/ApiGenreConverterTest.kt index 8552bf02..0f1a0bfe 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/ApiGenreConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/ApiGenreConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Genre @@ -31,7 +31,7 @@ class ApiGenreConverterTest { val domainEntitiesList = entitiesList.toDomainEntityList() - domainEntitiesList.size `should equal to` entitiesList.size + domainEntitiesList.size `should be equal to` entitiesList.size domainEntitiesList[0] `should equal` entitiesList[0].toDomainEntity() domainEntitiesList[1] `should equal` entitiesList[1].toDomainEntity() }