mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-17 12:10:41 +01:00
Update Ktlint to 0.20.0 version.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
46922d98ae
commit
eb09e9b417
@ -8,7 +8,7 @@ ext.versions = [
|
|||||||
gradle : '4.5.1',
|
gradle : '4.5.1',
|
||||||
|
|
||||||
androidTools : "3.0.1",
|
androidTools : "3.0.1",
|
||||||
ktlint : "0.15.1",
|
ktlint : "0.20.0",
|
||||||
ktlintGradle : "3.2.0",
|
ktlintGradle : "3.2.0",
|
||||||
detekt : "1.0.0.RC6-4",
|
detekt : "1.0.0.RC6-4",
|
||||||
jacoco : "0.7.9",
|
jacoco : "0.7.9",
|
||||||
|
@ -26,7 +26,8 @@ class MusicDirectory {
|
|||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
fun getChildren(
|
fun getChildren(
|
||||||
includeDirs: Boolean = true,
|
includeDirs: Boolean = true,
|
||||||
includeFiles: Boolean = true): List<Entry> {
|
includeFiles: Boolean = true
|
||||||
|
): List<Entry> {
|
||||||
if (includeDirs && includeFiles) {
|
if (includeDirs && includeFiles) {
|
||||||
return children
|
return children
|
||||||
}
|
}
|
||||||
|
@ -57,8 +57,10 @@ fun parseDate(dateAsString: String): Calendar {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T : SubsonicResponse> checkErrorCallParsed(mockWebServerRule: MockWebServerRule,
|
fun <T : SubsonicResponse> checkErrorCallParsed(
|
||||||
apiRequest: () -> Response<T>): T {
|
mockWebServerRule: MockWebServerRule,
|
||||||
|
apiRequest: () -> Response<T>
|
||||||
|
): T {
|
||||||
mockWebServerRule.enqueueResponse("request_data_not_found_error_response.json")
|
mockWebServerRule.enqueueResponse("request_data_not_found_error_response.json")
|
||||||
|
|
||||||
val response = apiRequest()
|
val response = apiRequest()
|
||||||
@ -77,9 +79,11 @@ fun SubsonicResponse.assertBaseResponseOk() {
|
|||||||
error `should be` null
|
error `should be` null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun MockWebServerRule.assertRequestParam(responseResourceName: String = "ping_ok.json",
|
fun MockWebServerRule.assertRequestParam(
|
||||||
|
responseResourceName: String = "ping_ok.json",
|
||||||
expectedParam: String,
|
expectedParam: String,
|
||||||
apiRequest: () -> Response<out Any>) {
|
apiRequest: () -> Response<out Any>
|
||||||
|
) {
|
||||||
this.enqueueResponse(responseResourceName)
|
this.enqueueResponse(responseResourceName)
|
||||||
apiRequest()
|
apiRequest()
|
||||||
|
|
||||||
|
@ -37,9 +37,11 @@ class SubsonicApiSSLTest {
|
|||||||
mockWebServer.shutdown()
|
mockWebServer.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createSSLContext(certificatePemStream: InputStream,
|
private fun createSSLContext(
|
||||||
|
certificatePemStream: InputStream,
|
||||||
certificatePkcs12Stream: InputStream,
|
certificatePkcs12Stream: InputStream,
|
||||||
password: String): SSLContext {
|
password: String
|
||||||
|
): SSLContext {
|
||||||
var cert: X509Certificate? = null
|
var cert: X509Certificate? = null
|
||||||
val trustStore = KeyStore.getInstance(KeyStore.getDefaultType())
|
val trustStore = KeyStore.getInstance(KeyStore.getDefaultType())
|
||||||
trustStore.load(null)
|
trustStore.load(null)
|
||||||
|
@ -7,5 +7,5 @@ import java.io.IOException
|
|||||||
* by current server api version.
|
* by current server api version.
|
||||||
*/
|
*/
|
||||||
class ApiNotSupportedException(
|
class ApiNotSupportedException(
|
||||||
serverApiVersion: SubsonicAPIVersions)
|
serverApiVersion: SubsonicAPIVersions
|
||||||
: IOException("Server api $serverApiVersion does not support this call")
|
) : IOException("Server api $serverApiVersion does not support this call")
|
||||||
|
@ -44,7 +44,8 @@ import retrofit2.Call
|
|||||||
*/
|
*/
|
||||||
internal class ApiVersionCheckWrapper(
|
internal class ApiVersionCheckWrapper(
|
||||||
val api: SubsonicAPIDefinition,
|
val api: SubsonicAPIDefinition,
|
||||||
var currentApiVersion: SubsonicAPIVersions) : SubsonicAPIDefinition by api {
|
var currentApiVersion: SubsonicAPIVersions
|
||||||
|
) : SubsonicAPIDefinition by api {
|
||||||
override fun getArtists(musicFolderId: String?): Call<GetArtistsResponse> {
|
override fun getArtists(musicFolderId: String?): Call<GetArtistsResponse> {
|
||||||
checkVersion(V1_8_0)
|
checkVersion(V1_8_0)
|
||||||
return api.getArtists(musicFolderId)
|
return api.getArtists(musicFolderId)
|
||||||
@ -70,26 +71,30 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.getAlbum(id)
|
return api.getAlbum(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun search2(query: String,
|
override fun search2(
|
||||||
|
query: String,
|
||||||
artistCount: Int?,
|
artistCount: Int?,
|
||||||
artistOffset: Int?,
|
artistOffset: Int?,
|
||||||
albumCount: Int?,
|
albumCount: Int?,
|
||||||
albumOffset: Int?,
|
albumOffset: Int?,
|
||||||
songCount: Int?,
|
songCount: Int?,
|
||||||
musicFolderId: String?): Call<SearchTwoResponse> {
|
musicFolderId: String?
|
||||||
|
): Call<SearchTwoResponse> {
|
||||||
checkVersion(V1_4_0)
|
checkVersion(V1_4_0)
|
||||||
checkParamVersion(musicFolderId, V1_12_0)
|
checkParamVersion(musicFolderId, V1_12_0)
|
||||||
return api.search2(query, artistCount, artistOffset, albumCount, albumOffset, songCount,
|
return api.search2(query, artistCount, artistOffset, albumCount, albumOffset, songCount,
|
||||||
musicFolderId)
|
musicFolderId)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun search3(query: String,
|
override fun search3(
|
||||||
|
query: String,
|
||||||
artistCount: Int?,
|
artistCount: Int?,
|
||||||
artistOffset: Int?,
|
artistOffset: Int?,
|
||||||
albumCount: Int?,
|
albumCount: Int?,
|
||||||
albumOffset: Int?,
|
albumOffset: Int?,
|
||||||
songCount: Int?,
|
songCount: Int?,
|
||||||
musicFolderId: String?): Call<SearchThreeResponse> {
|
musicFolderId: String?
|
||||||
|
): Call<SearchThreeResponse> {
|
||||||
checkVersion(V1_8_0)
|
checkVersion(V1_8_0)
|
||||||
checkParamVersion(musicFolderId, V1_12_0)
|
checkParamVersion(musicFolderId, V1_12_0)
|
||||||
return api.search3(query, artistCount, artistOffset, albumCount, albumOffset,
|
return api.search3(query, artistCount, artistOffset, albumCount, albumOffset,
|
||||||
@ -101,9 +106,11 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.getPlaylists(username)
|
return api.getPlaylists(username)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createPlaylist(id: String?,
|
override fun createPlaylist(
|
||||||
|
id: String?,
|
||||||
name: String?,
|
name: String?,
|
||||||
songIds: List<String>?): Call<SubsonicResponse> {
|
songIds: List<String>?
|
||||||
|
): Call<SubsonicResponse> {
|
||||||
checkVersion(V1_2_0)
|
checkVersion(V1_2_0)
|
||||||
return api.createPlaylist(id, name, songIds)
|
return api.createPlaylist(id, name, songIds)
|
||||||
}
|
}
|
||||||
@ -113,12 +120,14 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.deletePlaylist(id)
|
return api.deletePlaylist(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updatePlaylist(id: String,
|
override fun updatePlaylist(
|
||||||
|
id: String,
|
||||||
name: String?,
|
name: String?,
|
||||||
comment: String?,
|
comment: String?,
|
||||||
public: Boolean?,
|
public: Boolean?,
|
||||||
songIdsToAdd: List<String>?,
|
songIdsToAdd: List<String>?,
|
||||||
songIndexesToRemove: List<Int>?): Call<SubsonicResponse> {
|
songIndexesToRemove: List<Int>?
|
||||||
|
): Call<SubsonicResponse> {
|
||||||
checkVersion(V1_8_0)
|
checkVersion(V1_8_0)
|
||||||
return api.updatePlaylist(id, name, comment, public, songIdsToAdd, songIndexesToRemove)
|
return api.updatePlaylist(id, name, comment, public, songIdsToAdd, songIndexesToRemove)
|
||||||
}
|
}
|
||||||
@ -141,35 +150,41 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.scrobble(id, time, submission)
|
return api.scrobble(id, time, submission)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAlbumList(type: AlbumListType,
|
override fun getAlbumList(
|
||||||
|
type: AlbumListType,
|
||||||
size: Int?,
|
size: Int?,
|
||||||
offset: Int?,
|
offset: Int?,
|
||||||
fromYear: Int?,
|
fromYear: Int?,
|
||||||
toYear: Int?,
|
toYear: Int?,
|
||||||
genre: String?,
|
genre: String?,
|
||||||
musicFolderId: String?): Call<GetAlbumListResponse> {
|
musicFolderId: String?
|
||||||
|
): Call<GetAlbumListResponse> {
|
||||||
checkVersion(V1_2_0)
|
checkVersion(V1_2_0)
|
||||||
checkParamVersion(musicFolderId, V1_11_0)
|
checkParamVersion(musicFolderId, V1_11_0)
|
||||||
return api.getAlbumList(type, size, offset, fromYear, toYear, genre, musicFolderId)
|
return api.getAlbumList(type, size, offset, fromYear, toYear, genre, musicFolderId)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAlbumList2(type: AlbumListType,
|
override fun getAlbumList2(
|
||||||
|
type: AlbumListType,
|
||||||
size: Int?,
|
size: Int?,
|
||||||
offset: Int?,
|
offset: Int?,
|
||||||
fromYear: Int?,
|
fromYear: Int?,
|
||||||
toYear: Int?,
|
toYear: Int?,
|
||||||
genre: String?,
|
genre: String?,
|
||||||
musicFolderId: String?): Call<GetAlbumList2Response> {
|
musicFolderId: String?
|
||||||
|
): Call<GetAlbumList2Response> {
|
||||||
checkVersion(V1_8_0)
|
checkVersion(V1_8_0)
|
||||||
checkParamVersion(musicFolderId, V1_12_0)
|
checkParamVersion(musicFolderId, V1_12_0)
|
||||||
return api.getAlbumList2(type, size, offset, fromYear, toYear, genre, musicFolderId)
|
return api.getAlbumList2(type, size, offset, fromYear, toYear, genre, musicFolderId)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getRandomSongs(size: Int?,
|
override fun getRandomSongs(
|
||||||
|
size: Int?,
|
||||||
genre: String?,
|
genre: String?,
|
||||||
fromYear: Int?,
|
fromYear: Int?,
|
||||||
toYear: Int?,
|
toYear: Int?,
|
||||||
musicFolderId: String?): Call<GetRandomSongsResponse> {
|
musicFolderId: String?
|
||||||
|
): Call<GetRandomSongsResponse> {
|
||||||
checkVersion(V1_2_0)
|
checkVersion(V1_2_0)
|
||||||
return api.getRandomSongs(size, genre, fromYear, toYear, musicFolderId)
|
return api.getRandomSongs(size, genre, fromYear, toYear, musicFolderId)
|
||||||
}
|
}
|
||||||
@ -186,14 +201,16 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.getStarred2(musicFolderId)
|
return api.getStarred2(musicFolderId)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun stream(id: String,
|
override fun stream(
|
||||||
|
id: String,
|
||||||
maxBitRate: Int?,
|
maxBitRate: Int?,
|
||||||
format: String?,
|
format: String?,
|
||||||
timeOffset: Int?,
|
timeOffset: Int?,
|
||||||
videoSize: String?,
|
videoSize: String?,
|
||||||
estimateContentLength: Boolean?,
|
estimateContentLength: Boolean?,
|
||||||
converted: Boolean?,
|
converted: Boolean?,
|
||||||
offset: Long?): Call<ResponseBody> {
|
offset: Long?
|
||||||
|
): Call<ResponseBody> {
|
||||||
checkParamVersion(maxBitRate, V1_2_0)
|
checkParamVersion(maxBitRate, V1_2_0)
|
||||||
checkParamVersion(format, V1_6_0)
|
checkParamVersion(format, V1_6_0)
|
||||||
checkParamVersion(videoSize, V1_6_0)
|
checkParamVersion(videoSize, V1_6_0)
|
||||||
@ -203,11 +220,13 @@ internal class ApiVersionCheckWrapper(
|
|||||||
estimateContentLength, converted)
|
estimateContentLength, converted)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun jukeboxControl(action: JukeboxAction,
|
override fun jukeboxControl(
|
||||||
|
action: JukeboxAction,
|
||||||
index: Int?,
|
index: Int?,
|
||||||
offset: Int?,
|
offset: Int?,
|
||||||
ids: List<String>?,
|
ids: List<String>?,
|
||||||
gain: Float?): Call<JukeboxResponse> {
|
gain: Float?
|
||||||
|
): Call<JukeboxResponse> {
|
||||||
checkVersion(V1_2_0)
|
checkVersion(V1_2_0)
|
||||||
checkParamVersion(offset, V1_7_0)
|
checkParamVersion(offset, V1_7_0)
|
||||||
return api.jukeboxControl(action, index, offset, ids, gain)
|
return api.jukeboxControl(action, index, offset, ids, gain)
|
||||||
@ -218,9 +237,11 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.getShares()
|
return api.getShares()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createShare(idsToShare: List<String>,
|
override fun createShare(
|
||||||
|
idsToShare: List<String>,
|
||||||
description: String?,
|
description: String?,
|
||||||
expires: Long?): Call<SharesResponse> {
|
expires: Long?
|
||||||
|
): Call<SharesResponse> {
|
||||||
checkVersion(V1_6_0)
|
checkVersion(V1_6_0)
|
||||||
return api.createShare(idsToShare, description, expires)
|
return api.createShare(idsToShare, description, expires)
|
||||||
}
|
}
|
||||||
@ -230,9 +251,11 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.deleteShare(id)
|
return api.deleteShare(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateShare(id: String,
|
override fun updateShare(
|
||||||
|
id: String,
|
||||||
description: String?,
|
description: String?,
|
||||||
expires: Long?): Call<SubsonicResponse> {
|
expires: Long?
|
||||||
|
): Call<SubsonicResponse> {
|
||||||
checkVersion(V1_6_0)
|
checkVersion(V1_6_0)
|
||||||
return api.updateShare(id, description, expires)
|
return api.updateShare(id, description, expires)
|
||||||
}
|
}
|
||||||
@ -242,10 +265,12 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.getGenres()
|
return api.getGenres()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSongsByGenre(genre: String,
|
override fun getSongsByGenre(
|
||||||
|
genre: String,
|
||||||
count: Int,
|
count: Int,
|
||||||
offset: Int,
|
offset: Int,
|
||||||
musicFolderId: String?): Call<GetSongsByGenreResponse> {
|
musicFolderId: String?
|
||||||
|
): Call<GetSongsByGenreResponse> {
|
||||||
checkVersion(V1_9_0)
|
checkVersion(V1_9_0)
|
||||||
checkParamVersion(musicFolderId, V1_12_0)
|
checkParamVersion(musicFolderId, V1_12_0)
|
||||||
return api.getSongsByGenre(genre, count, offset, musicFolderId)
|
return api.getSongsByGenre(genre, count, offset, musicFolderId)
|
||||||
@ -271,9 +296,11 @@ internal class ApiVersionCheckWrapper(
|
|||||||
return api.getBookmarks()
|
return api.getBookmarks()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createBookmark(id: String,
|
override fun createBookmark(
|
||||||
|
id: String,
|
||||||
position: Long,
|
position: Long,
|
||||||
comment: String?): Call<SubsonicResponse> {
|
comment: String?
|
||||||
|
): Call<SubsonicResponse> {
|
||||||
checkVersion(V1_9_0)
|
checkVersion(V1_9_0)
|
||||||
return api.createBookmark(id, position, comment)
|
return api.createBookmark(id, position, comment)
|
||||||
}
|
}
|
||||||
|
@ -35,14 +35,16 @@ private const val READ_TIMEOUT = 60_000L
|
|||||||
*
|
*
|
||||||
* @author Yahor Berdnikau
|
* @author Yahor Berdnikau
|
||||||
*/
|
*/
|
||||||
class SubsonicAPIClient(baseUrl: String,
|
class SubsonicAPIClient(
|
||||||
|
baseUrl: String,
|
||||||
username: String,
|
username: String,
|
||||||
password: String,
|
password: String,
|
||||||
minimalProtocolVersion: SubsonicAPIVersions,
|
minimalProtocolVersion: SubsonicAPIVersions,
|
||||||
clientID: String,
|
clientID: String,
|
||||||
allowSelfSignedCertificate: Boolean = false,
|
allowSelfSignedCertificate: Boolean = false,
|
||||||
enableLdapUserSupport: Boolean = false,
|
enableLdapUserSupport: Boolean = false,
|
||||||
debug: Boolean = false) {
|
debug: Boolean = false
|
||||||
|
) {
|
||||||
private val versionInterceptor = VersionInterceptor(minimalProtocolVersion) {
|
private val versionInterceptor = VersionInterceptor(minimalProtocolVersion) {
|
||||||
protocolVersion = it
|
protocolVersion = it
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,10 @@ interface SubsonicAPIDefinition {
|
|||||||
fun getMusicFolders(): Call<MusicFoldersResponse>
|
fun getMusicFolders(): Call<MusicFoldersResponse>
|
||||||
|
|
||||||
@GET("getIndexes.view")
|
@GET("getIndexes.view")
|
||||||
fun getIndexes(@Query("musicFolderId") musicFolderId: String?,
|
fun getIndexes(
|
||||||
@Query("ifModifiedSince") ifModifiedSince: Long?): Call<GetIndexesResponse>
|
@Query("musicFolderId") musicFolderId: String?,
|
||||||
|
@Query("ifModifiedSince") ifModifiedSince: Long?
|
||||||
|
): Call<GetIndexesResponse>
|
||||||
|
|
||||||
@GET("getMusicDirectory.view")
|
@GET("getMusicDirectory.view")
|
||||||
fun getMusicDirectory(@Query("id") id: String): Call<GetMusicDirectoryResponse>
|
fun getMusicDirectory(@Query("id") id: String): Call<GetMusicDirectoryResponse>
|
||||||
@ -64,14 +66,18 @@ interface SubsonicAPIDefinition {
|
|||||||
fun getArtists(@Query("musicFolderId") musicFolderId: String?): Call<GetArtistsResponse>
|
fun getArtists(@Query("musicFolderId") musicFolderId: String?): Call<GetArtistsResponse>
|
||||||
|
|
||||||
@GET("star.view")
|
@GET("star.view")
|
||||||
fun star(@Query("id") id: String? = null,
|
fun star(
|
||||||
|
@Query("id") id: String? = null,
|
||||||
@Query("albumId") albumId: String? = null,
|
@Query("albumId") albumId: String? = null,
|
||||||
@Query("artistId") artistId: String? = null): Call<SubsonicResponse>
|
@Query("artistId") artistId: String? = null
|
||||||
|
): Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("unstar.view")
|
@GET("unstar.view")
|
||||||
fun unstar(@Query("id") id: String? = null,
|
fun unstar(
|
||||||
|
@Query("id") id: String? = null,
|
||||||
@Query("albumId") albumId: String? = null,
|
@Query("albumId") albumId: String? = null,
|
||||||
@Query("artistId") artistId: String? = null): Call<SubsonicResponse>
|
@Query("artistId") artistId: String? = null
|
||||||
|
): Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("getArtist.view")
|
@GET("getArtist.view")
|
||||||
fun getArtist(@Query("id") id: String): Call<GetArtistResponse>
|
fun getArtist(@Query("id") id: String): Call<GetArtistResponse>
|
||||||
@ -80,31 +86,37 @@ interface SubsonicAPIDefinition {
|
|||||||
fun getAlbum(@Query("id") id: String): Call<GetAlbumResponse>
|
fun getAlbum(@Query("id") id: String): Call<GetAlbumResponse>
|
||||||
|
|
||||||
@GET("search.view")
|
@GET("search.view")
|
||||||
fun search(@Query("artist") artist: String? = null,
|
fun search(
|
||||||
|
@Query("artist") artist: String? = null,
|
||||||
@Query("album") album: String? = null,
|
@Query("album") album: String? = null,
|
||||||
@Query("title") title: String? = null,
|
@Query("title") title: String? = null,
|
||||||
@Query("any") any: String? = null,
|
@Query("any") any: String? = null,
|
||||||
@Query("count") count: Int? = null,
|
@Query("count") count: Int? = null,
|
||||||
@Query("offset") offset: Int? = null,
|
@Query("offset") offset: Int? = null,
|
||||||
@Query("newerThan") newerThan: Long? = null): Call<SearchResponse>
|
@Query("newerThan") newerThan: Long? = null
|
||||||
|
): Call<SearchResponse>
|
||||||
|
|
||||||
@GET("search2.view")
|
@GET("search2.view")
|
||||||
fun search2(@Query("query") query: String,
|
fun search2(
|
||||||
|
@Query("query") query: String,
|
||||||
@Query("artistCount") artistCount: Int? = null,
|
@Query("artistCount") artistCount: Int? = null,
|
||||||
@Query("artistOffset") artistOffset: Int? = null,
|
@Query("artistOffset") artistOffset: Int? = null,
|
||||||
@Query("albumCount") albumCount: Int? = null,
|
@Query("albumCount") albumCount: Int? = null,
|
||||||
@Query("albumOffset") albumOffset: Int? = null,
|
@Query("albumOffset") albumOffset: Int? = null,
|
||||||
@Query("songCount") songCount: Int? = null,
|
@Query("songCount") songCount: Int? = null,
|
||||||
@Query("musicFolderId") musicFolderId: String? = null): Call<SearchTwoResponse>
|
@Query("musicFolderId") musicFolderId: String? = null
|
||||||
|
): Call<SearchTwoResponse>
|
||||||
|
|
||||||
@GET("search3.view")
|
@GET("search3.view")
|
||||||
fun search3(@Query("query") query: String,
|
fun search3(
|
||||||
|
@Query("query") query: String,
|
||||||
@Query("artistCount") artistCount: Int? = null,
|
@Query("artistCount") artistCount: Int? = null,
|
||||||
@Query("artistOffset") artistOffset: Int? = null,
|
@Query("artistOffset") artistOffset: Int? = null,
|
||||||
@Query("albumCount") albumCount: Int? = null,
|
@Query("albumCount") albumCount: Int? = null,
|
||||||
@Query("albumOffset") albumOffset: Int? = null,
|
@Query("albumOffset") albumOffset: Int? = null,
|
||||||
@Query("songCount") songCount: Int? = null,
|
@Query("songCount") songCount: Int? = null,
|
||||||
@Query("musicFolderId") musicFolderId: String? = null): Call<SearchThreeResponse>
|
@Query("musicFolderId") musicFolderId: String? = null
|
||||||
|
): Call<SearchThreeResponse>
|
||||||
|
|
||||||
@GET("getPlaylist.view")
|
@GET("getPlaylist.view")
|
||||||
fun getPlaylist(@Query("id") id: String): Call<GetPlaylistResponse>
|
fun getPlaylist(@Query("id") id: String): Call<GetPlaylistResponse>
|
||||||
@ -113,9 +125,11 @@ interface SubsonicAPIDefinition {
|
|||||||
fun getPlaylists(@Query("username") username: String? = null): Call<GetPlaylistsResponse>
|
fun getPlaylists(@Query("username") username: String? = null): Call<GetPlaylistsResponse>
|
||||||
|
|
||||||
@GET("createPlaylist.view")
|
@GET("createPlaylist.view")
|
||||||
fun createPlaylist(@Query("playlistId") id: String? = null,
|
fun createPlaylist(
|
||||||
|
@Query("playlistId") id: String? = null,
|
||||||
@Query("name") name: String? = null,
|
@Query("name") name: String? = null,
|
||||||
@Query("songId") songIds: List<String>? = null): Call<SubsonicResponse>
|
@Query("songId") songIds: List<String>? = null
|
||||||
|
): Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("deletePlaylist.view")
|
@GET("deletePlaylist.view")
|
||||||
fun deletePlaylist(@Query("id") id: String): Call<SubsonicResponse>
|
fun deletePlaylist(@Query("id") id: String): Call<SubsonicResponse>
|
||||||
@ -127,21 +141,28 @@ interface SubsonicAPIDefinition {
|
|||||||
@Query("comment") comment: String? = null,
|
@Query("comment") comment: String? = null,
|
||||||
@Query("public") public: Boolean? = null,
|
@Query("public") public: Boolean? = null,
|
||||||
@Query("songIdToAdd") songIdsToAdd: List<String>? = null,
|
@Query("songIdToAdd") songIdsToAdd: List<String>? = null,
|
||||||
@Query("songIndexToRemove") songIndexesToRemove: List<Int>? = null):
|
@Query("songIndexToRemove") songIndexesToRemove: List<Int>? = null
|
||||||
|
):
|
||||||
Call<SubsonicResponse>
|
Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("getPodcasts.view")
|
@GET("getPodcasts.view")
|
||||||
fun getPodcasts(@Query("includeEpisodes") includeEpisodes: Boolean? = null,
|
fun getPodcasts(
|
||||||
@Query("id") id: String? = null): Call<GetPodcastsResponse>
|
@Query("includeEpisodes") includeEpisodes: Boolean? = null,
|
||||||
|
@Query("id") id: String? = null
|
||||||
|
): Call<GetPodcastsResponse>
|
||||||
|
|
||||||
@GET("getLyrics.view")
|
@GET("getLyrics.view")
|
||||||
fun getLyrics(@Query("artist") artist: String? = null,
|
fun getLyrics(
|
||||||
@Query("title") title: String? = null): Call<GetLyricsResponse>
|
@Query("artist") artist: String? = null,
|
||||||
|
@Query("title") title: String? = null
|
||||||
|
): Call<GetLyricsResponse>
|
||||||
|
|
||||||
@GET("scrobble.view")
|
@GET("scrobble.view")
|
||||||
fun scrobble(@Query("id") id: String,
|
fun scrobble(
|
||||||
|
@Query("id") id: String,
|
||||||
@Query("time") time: Long? = null,
|
@Query("time") time: Long? = null,
|
||||||
@Query("submission") submission: Boolean? = null): Call<SubsonicResponse>
|
@Query("submission") submission: Boolean? = null
|
||||||
|
): Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("getAlbumList.view")
|
@GET("getAlbumList.view")
|
||||||
fun getAlbumList(
|
fun getAlbumList(
|
||||||
@ -151,7 +172,8 @@ interface SubsonicAPIDefinition {
|
|||||||
@Query("fromYear") fromYear: Int? = null,
|
@Query("fromYear") fromYear: Int? = null,
|
||||||
@Query("toYear") toYear: Int? = null,
|
@Query("toYear") toYear: Int? = null,
|
||||||
@Query("genre") genre: String? = null,
|
@Query("genre") genre: String? = null,
|
||||||
@Query("musicFolderId") musicFolderId: String? = null): Call<GetAlbumListResponse>
|
@Query("musicFolderId") musicFolderId: String? = null
|
||||||
|
): Call<GetAlbumListResponse>
|
||||||
|
|
||||||
@GET("getAlbumList2.view")
|
@GET("getAlbumList2.view")
|
||||||
fun getAlbumList2(
|
fun getAlbumList2(
|
||||||
@ -161,7 +183,8 @@ interface SubsonicAPIDefinition {
|
|||||||
@Query("fromYear") fromYear: Int? = null,
|
@Query("fromYear") fromYear: Int? = null,
|
||||||
@Query("toYear") toYear: Int? = null,
|
@Query("toYear") toYear: Int? = null,
|
||||||
@Query("genre") genre: String? = null,
|
@Query("genre") genre: String? = null,
|
||||||
@Query("musicFolderId") musicFolderId: String? = null): Call<GetAlbumList2Response>
|
@Query("musicFolderId") musicFolderId: String? = null
|
||||||
|
): Call<GetAlbumList2Response>
|
||||||
|
|
||||||
@GET("getRandomSongs.view")
|
@GET("getRandomSongs.view")
|
||||||
fun getRandomSongs(
|
fun getRandomSongs(
|
||||||
@ -169,53 +192,65 @@ interface SubsonicAPIDefinition {
|
|||||||
@Query("genre") genre: String? = null,
|
@Query("genre") genre: String? = null,
|
||||||
@Query("fromYear") fromYear: Int? = null,
|
@Query("fromYear") fromYear: Int? = null,
|
||||||
@Query("toYear") toYear: Int? = null,
|
@Query("toYear") toYear: Int? = null,
|
||||||
@Query("musicFolderId") musicFolderId: String? = null): Call<GetRandomSongsResponse>
|
@Query("musicFolderId") musicFolderId: String? = null
|
||||||
|
): Call<GetRandomSongsResponse>
|
||||||
|
|
||||||
@GET("getStarred.view")
|
@GET("getStarred.view")
|
||||||
fun getStarred(@Query("musicFolderId") musicFolderId: String? = null): Call<GetStarredResponse>
|
fun getStarred(@Query("musicFolderId") musicFolderId: String? = null): Call<GetStarredResponse>
|
||||||
|
|
||||||
@GET("getStarred2.view")
|
@GET("getStarred2.view")
|
||||||
fun getStarred2(
|
fun getStarred2(
|
||||||
@Query("musicFolderId") musicFolderId: String? = null): Call<GetStarredTwoResponse>
|
@Query("musicFolderId") musicFolderId: String? = null
|
||||||
|
): Call<GetStarredTwoResponse>
|
||||||
|
|
||||||
@Streaming
|
@Streaming
|
||||||
@GET("getCoverArt.view")
|
@GET("getCoverArt.view")
|
||||||
fun getCoverArt(@Query("id") id: String,
|
fun getCoverArt(
|
||||||
@Query("size") size: Long? = null): Call<ResponseBody>
|
@Query("id") id: String,
|
||||||
|
@Query("size") size: Long? = null
|
||||||
|
): Call<ResponseBody>
|
||||||
|
|
||||||
@Streaming
|
@Streaming
|
||||||
@GET("stream.view")
|
@GET("stream.view")
|
||||||
fun stream(@Query("id") id: String,
|
fun stream(
|
||||||
|
@Query("id") id: String,
|
||||||
@Query("maxBitRate") maxBitRate: Int? = null,
|
@Query("maxBitRate") maxBitRate: Int? = null,
|
||||||
@Query("format") format: String? = null,
|
@Query("format") format: String? = null,
|
||||||
@Query("timeOffset") timeOffset: Int? = null,
|
@Query("timeOffset") timeOffset: Int? = null,
|
||||||
@Query("size") videoSize: String? = null,
|
@Query("size") videoSize: String? = null,
|
||||||
@Query("estimateContentLength") estimateContentLength: Boolean? = null,
|
@Query("estimateContentLength") estimateContentLength: Boolean? = null,
|
||||||
@Query("converted") converted: Boolean? = null,
|
@Query("converted") converted: Boolean? = null,
|
||||||
@Header("Range") offset: Long? = null): Call<ResponseBody>
|
@Header("Range") offset: Long? = null
|
||||||
|
): Call<ResponseBody>
|
||||||
|
|
||||||
@GET("jukeboxControl.view")
|
@GET("jukeboxControl.view")
|
||||||
fun jukeboxControl(@Query("action") action: JukeboxAction,
|
fun jukeboxControl(
|
||||||
|
@Query("action") action: JukeboxAction,
|
||||||
@Query("index") index: Int? = null,
|
@Query("index") index: Int? = null,
|
||||||
@Query("offset") offset: Int? = null,
|
@Query("offset") offset: Int? = null,
|
||||||
@Query("id") ids: List<String>? = null,
|
@Query("id") ids: List<String>? = null,
|
||||||
@Query("gain") gain: Float? = null): Call<JukeboxResponse>
|
@Query("gain") gain: Float? = null
|
||||||
|
): Call<JukeboxResponse>
|
||||||
|
|
||||||
@GET("getShares.view")
|
@GET("getShares.view")
|
||||||
fun getShares(): Call<SharesResponse>
|
fun getShares(): Call<SharesResponse>
|
||||||
|
|
||||||
@GET("createShare.view")
|
@GET("createShare.view")
|
||||||
fun createShare(@Query("id") idsToShare: List<String>,
|
fun createShare(
|
||||||
|
@Query("id") idsToShare: List<String>,
|
||||||
@Query("description") description: String? = null,
|
@Query("description") description: String? = null,
|
||||||
@Query("expires") expires: Long? = null): Call<SharesResponse>
|
@Query("expires") expires: Long? = null
|
||||||
|
): Call<SharesResponse>
|
||||||
|
|
||||||
@GET("deleteShare.view")
|
@GET("deleteShare.view")
|
||||||
fun deleteShare(@Query("id") id: String): Call<SubsonicResponse>
|
fun deleteShare(@Query("id") id: String): Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("updateShare.view")
|
@GET("updateShare.view")
|
||||||
fun updateShare(@Query("id") id: String,
|
fun updateShare(
|
||||||
|
@Query("id") id: String,
|
||||||
@Query("description") description: String? = null,
|
@Query("description") description: String? = null,
|
||||||
@Query("expires") expires: Long? = null): Call<SubsonicResponse>
|
@Query("expires") expires: Long? = null
|
||||||
|
): Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("getGenres.view")
|
@GET("getGenres.view")
|
||||||
fun getGenres(): Call<GenresResponse>
|
fun getGenres(): Call<GenresResponse>
|
||||||
@ -225,7 +260,8 @@ interface SubsonicAPIDefinition {
|
|||||||
@Query("genre") genre: String,
|
@Query("genre") genre: String,
|
||||||
@Query("count") count: Int = 10,
|
@Query("count") count: Int = 10,
|
||||||
@Query("offset") offset: Int = 0,
|
@Query("offset") offset: Int = 0,
|
||||||
@Query("musicFolderId") musicFolderId: String? = null): Call<GetSongsByGenreResponse>
|
@Query("musicFolderId") musicFolderId: String? = null
|
||||||
|
): Call<GetSongsByGenreResponse>
|
||||||
|
|
||||||
@GET("getUser.view")
|
@GET("getUser.view")
|
||||||
fun getUser(@Query("username") username: String): Call<GetUserResponse>
|
fun getUser(@Query("username") username: String): Call<GetUserResponse>
|
||||||
@ -243,7 +279,8 @@ interface SubsonicAPIDefinition {
|
|||||||
fun createBookmark(
|
fun createBookmark(
|
||||||
@Query("id") id: String,
|
@Query("id") id: String,
|
||||||
@Query("position") position: Long,
|
@Query("position") position: Long,
|
||||||
@Query("comment") comment: String? = null): Call<SubsonicResponse>
|
@Query("comment") comment: String? = null
|
||||||
|
): Call<SubsonicResponse>
|
||||||
|
|
||||||
@GET("deleteBookmark.view")
|
@GET("deleteBookmark.view")
|
||||||
fun deleteBookmark(@Query("id") id: String): Call<SubsonicResponse>
|
fun deleteBookmark(@Query("id") id: String): Call<SubsonicResponse>
|
||||||
|
@ -56,8 +56,10 @@ enum class SubsonicAPIVersions(val subsonicVersions: String, val restApiVersion:
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SubsonicAPIVersionsDeserializer : JsonDeserializer<SubsonicAPIVersions>() {
|
class SubsonicAPIVersionsDeserializer : JsonDeserializer<SubsonicAPIVersions>() {
|
||||||
override fun deserialize(p: JsonParser,
|
override fun deserialize(
|
||||||
ctxt: DeserializationContext?): SubsonicAPIVersions {
|
p: JsonParser,
|
||||||
|
ctxt: DeserializationContext?
|
||||||
|
): SubsonicAPIVersions {
|
||||||
if (p.currentName != "version") {
|
if (p.currentName != "version") {
|
||||||
throw JsonParseException(p, "Not valid token for API version!")
|
throw JsonParseException(p, "Not valid token for API version!")
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,8 @@ private const val DEFAULT_PEEK_BYTE_COUNT = 1000L
|
|||||||
*/
|
*/
|
||||||
internal class VersionInterceptor(
|
internal class VersionInterceptor(
|
||||||
internal var protocolVersion: SubsonicAPIVersions,
|
internal var protocolVersion: SubsonicAPIVersions,
|
||||||
private val notifier: (SubsonicAPIVersions) -> Unit = {}) : Interceptor {
|
private val notifier: (SubsonicAPIVersions) -> Unit = {}
|
||||||
|
) : Interceptor {
|
||||||
private val jsonFactory = JsonFactory()
|
private val jsonFactory = JsonFactory()
|
||||||
|
|
||||||
override fun intercept(chain: Chain): okhttp3.Response {
|
override fun intercept(chain: Chain): okhttp3.Response {
|
||||||
|
@ -14,4 +14,5 @@ data class Album(
|
|||||||
val created: Calendar? = null,
|
val created: Calendar? = null,
|
||||||
val year: Int = 0,
|
val year: Int = 0,
|
||||||
val genre: String = "",
|
val genre: String = "",
|
||||||
@JsonProperty("song") val songList: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("song") val songList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -3,10 +3,12 @@ package org.moire.ultrasonic.api.subsonic.models
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
|
|
||||||
data class Artist(val id: String = "",
|
data class Artist(
|
||||||
|
val id: String = "",
|
||||||
val name: String = "",
|
val name: String = "",
|
||||||
val coverArt: String = "",
|
val coverArt: String = "",
|
||||||
val albumCount: Int = 0,
|
val albumCount: Int = 0,
|
||||||
val starred: Calendar? = null,
|
val starred: Calendar? = null,
|
||||||
@JsonProperty("album")
|
@JsonProperty("album")
|
||||||
val albumsList: List<Album> = emptyList())
|
val albumsList: List<Album> = emptyList()
|
||||||
|
)
|
||||||
|
@ -8,4 +8,5 @@ data class Bookmark(
|
|||||||
val comment: String = "",
|
val comment: String = "",
|
||||||
val created: Calendar? = null,
|
val created: Calendar? = null,
|
||||||
val changed: Calendar? = null,
|
val changed: Calendar? = null,
|
||||||
val entry: MusicDirectoryChild = MusicDirectoryChild())
|
val entry: MusicDirectoryChild = MusicDirectoryChild()
|
||||||
|
)
|
||||||
|
@ -3,4 +3,5 @@ package org.moire.ultrasonic.api.subsonic.models
|
|||||||
data class ChatMessage(
|
data class ChatMessage(
|
||||||
val username: String = "",
|
val username: String = "",
|
||||||
val time: Long = 0,
|
val time: Long = 0,
|
||||||
val message: String = "")
|
val message: String = ""
|
||||||
|
)
|
||||||
|
@ -2,6 +2,8 @@ package org.moire.ultrasonic.api.subsonic.models
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
|
||||||
data class Genre(val songCount: Int = 0,
|
data class Genre(
|
||||||
|
val songCount: Int = 0,
|
||||||
val albumCount: Int = 0,
|
val albumCount: Int = 0,
|
||||||
@JsonProperty("value") val name: String)
|
@JsonProperty("value") val name: String
|
||||||
|
)
|
||||||
|
@ -2,6 +2,8 @@ package org.moire.ultrasonic.api.subsonic.models
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
|
||||||
data class Index(val name: String = "",
|
data class Index(
|
||||||
|
val name: String = "",
|
||||||
@JsonProperty("artist")
|
@JsonProperty("artist")
|
||||||
val artists: List<Artist> = emptyList())
|
val artists: List<Artist> = emptyList()
|
||||||
|
)
|
||||||
|
@ -2,9 +2,11 @@ package org.moire.ultrasonic.api.subsonic.models
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
|
||||||
data class Indexes(val lastModified: Long = 0,
|
data class Indexes(
|
||||||
|
val lastModified: Long = 0,
|
||||||
val ignoredArticles: String = "",
|
val ignoredArticles: String = "",
|
||||||
@JsonProperty("index")
|
@JsonProperty("index")
|
||||||
val indexList: List<Index> = emptyList(),
|
val indexList: List<Index> = emptyList(),
|
||||||
@JsonProperty("shortcut")
|
@JsonProperty("shortcut")
|
||||||
val shortcutList: List<Artist> = emptyList())
|
val shortcutList: List<Artist> = emptyList()
|
||||||
|
)
|
||||||
|
@ -7,4 +7,5 @@ data class JukeboxStatus(
|
|||||||
val playing: Boolean = false,
|
val playing: Boolean = false,
|
||||||
val gain: Float = 0.0f,
|
val gain: Float = 0.0f,
|
||||||
val position: Int = 0,
|
val position: Int = 0,
|
||||||
@JsonProperty("entry") val playlistEntries: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("entry") val playlistEntries: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -6,4 +6,5 @@ data class License(
|
|||||||
val valid: Boolean = false,
|
val valid: Boolean = false,
|
||||||
val email: String = "",
|
val email: String = "",
|
||||||
val trialExpires: Calendar = Calendar.getInstance(),
|
val trialExpires: Calendar = Calendar.getInstance(),
|
||||||
val licenseExpires: Calendar = Calendar.getInstance())
|
val licenseExpires: Calendar = Calendar.getInstance()
|
||||||
|
)
|
||||||
|
@ -5,4 +5,5 @@ import com.fasterxml.jackson.annotation.JsonProperty
|
|||||||
data class Lyrics(
|
data class Lyrics(
|
||||||
val artist: String = "",
|
val artist: String = "",
|
||||||
val title: String = "",
|
val title: String = "",
|
||||||
@JsonProperty("value") val text: String = "")
|
@JsonProperty("value") val text: String = ""
|
||||||
|
)
|
||||||
|
@ -3,7 +3,8 @@ package org.moire.ultrasonic.api.subsonic.models
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
|
|
||||||
data class MusicDirectory(val id: String = "",
|
data class MusicDirectory(
|
||||||
|
val id: String = "",
|
||||||
val parent: String = "",
|
val parent: String = "",
|
||||||
val name: String = "",
|
val name: String = "",
|
||||||
val userRating: Int = 0,
|
val userRating: Int = 0,
|
||||||
@ -11,4 +12,5 @@ data class MusicDirectory(val id: String = "",
|
|||||||
val starred: Calendar? = null,
|
val starred: Calendar? = null,
|
||||||
val playCount: Int = 0,
|
val playCount: Int = 0,
|
||||||
@JsonProperty("child")
|
@JsonProperty("child")
|
||||||
val childList: List<MusicDirectoryChild> = emptyList())
|
val childList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -2,7 +2,8 @@ package org.moire.ultrasonic.api.subsonic.models
|
|||||||
|
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
|
|
||||||
data class MusicDirectoryChild(val id: String = "",
|
data class MusicDirectoryChild(
|
||||||
|
val id: String = "",
|
||||||
val parent: String = "",
|
val parent: String = "",
|
||||||
val isDir: Boolean = false,
|
val isDir: Boolean = false,
|
||||||
val title: String = "",
|
val title: String = "",
|
||||||
@ -34,4 +35,5 @@ data class MusicDirectoryChild(val id: String = "",
|
|||||||
val status: String = "",
|
val status: String = "",
|
||||||
val publishDate: Calendar? = null,
|
val publishDate: Calendar? = null,
|
||||||
val userRating: Int? = null,
|
val userRating: Int? = null,
|
||||||
val averageRating: Float? = null)
|
val averageRating: Float? = null
|
||||||
|
)
|
||||||
|
@ -11,4 +11,5 @@ data class PodcastChannel(
|
|||||||
val originalImageUrl: String = "",
|
val originalImageUrl: String = "",
|
||||||
val status: String = "",
|
val status: String = "",
|
||||||
val errorMessage: String = "",
|
val errorMessage: String = "",
|
||||||
@JsonProperty("episode") val episodeList: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("episode") val episodeList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -5,4 +5,5 @@ import com.fasterxml.jackson.annotation.JsonProperty
|
|||||||
data class SearchResult(
|
data class SearchResult(
|
||||||
val offset: Int = 0,
|
val offset: Int = 0,
|
||||||
val totalHits: Int = 0,
|
val totalHits: Int = 0,
|
||||||
@JsonProperty("match") val matchList: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("match") val matchList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -12,4 +12,5 @@ data class Share(
|
|||||||
val visitCount: Int = 0,
|
val visitCount: Int = 0,
|
||||||
val description: String = "",
|
val description: String = "",
|
||||||
val lastVisited: Calendar? = null,
|
val lastVisited: Calendar? = null,
|
||||||
@JsonProperty("entry") val items: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("entry") val items: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -18,4 +18,5 @@ data class User(
|
|||||||
val jukeboxRole: Boolean = false,
|
val jukeboxRole: Boolean = false,
|
||||||
val shareRole: Boolean = false,
|
val shareRole: Boolean = false,
|
||||||
val videoConverstionRole: Boolean = false,
|
val videoConverstionRole: Boolean = false,
|
||||||
@JsonProperty("folder") val folderList: List<Int> = emptyList())
|
@JsonProperty("folder") val folderList: List<Int> = emptyList()
|
||||||
|
)
|
||||||
|
@ -8,11 +8,13 @@ import org.moire.ultrasonic.api.subsonic.models.Bookmark
|
|||||||
class BookmarksResponse(
|
class BookmarksResponse(
|
||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) : SubsonicResponse(status, version, error) {
|
error: SubsonicError?
|
||||||
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("bookmarks") private val bookmarksWrapper = BookmarkWrapper()
|
@JsonProperty("bookmarks") private val bookmarksWrapper = BookmarkWrapper()
|
||||||
|
|
||||||
val bookmarkList: List<Bookmark> get() = bookmarksWrapper.bookmarkList
|
val bookmarkList: List<Bookmark> get() = bookmarksWrapper.bookmarkList
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class BookmarkWrapper(
|
internal class BookmarkWrapper(
|
||||||
@JsonProperty("bookmark") val bookmarkList: List<Bookmark> = emptyList())
|
@JsonProperty("bookmark") val bookmarkList: List<Bookmark> = emptyList()
|
||||||
|
)
|
||||||
|
@ -8,11 +8,13 @@ import org.moire.ultrasonic.api.subsonic.models.ChatMessage
|
|||||||
class ChatMessagesResponse(
|
class ChatMessagesResponse(
|
||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) : SubsonicResponse(status, version, error) {
|
error: SubsonicError?
|
||||||
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("chatMessages") private val wrapper = ChatMessagesWrapper()
|
@JsonProperty("chatMessages") private val wrapper = ChatMessagesWrapper()
|
||||||
|
|
||||||
val chatMessages: List<ChatMessage> get() = wrapper.messagesList
|
val chatMessages: List<ChatMessage> get() = wrapper.messagesList
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class ChatMessagesWrapper(
|
internal class ChatMessagesWrapper(
|
||||||
@JsonProperty("chatMessage") val messagesList: List<ChatMessage> = emptyList())
|
@JsonProperty("chatMessage") val messagesList: List<ChatMessage> = emptyList()
|
||||||
|
)
|
||||||
|
@ -5,9 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Genre
|
import org.moire.ultrasonic.api.subsonic.models.Genre
|
||||||
|
|
||||||
class GenresResponse(status: Status,
|
class GenresResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) : SubsonicResponse(status, version, error) {
|
error: SubsonicError?
|
||||||
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("genres") private val genresWrapper = GenresWrapper()
|
@JsonProperty("genres") private val genresWrapper = GenresWrapper()
|
||||||
val genresList: List<Genre> get() = genresWrapper.genresList
|
val genresList: List<Genre> get() = genresWrapper.genresList
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError
|
|||||||
import org.moire.ultrasonic.api.subsonic.models.Album
|
import org.moire.ultrasonic.api.subsonic.models.Album
|
||||||
|
|
||||||
@Suppress("NamingConventionViolation")
|
@Suppress("NamingConventionViolation")
|
||||||
class GetAlbumList2Response(status: Status,
|
class GetAlbumList2Response(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?)
|
error: SubsonicError?
|
||||||
: SubsonicResponse(status, version, error) {
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("albumList2") private val albumWrapper2 = AlbumWrapper2()
|
@JsonProperty("albumList2") private val albumWrapper2 = AlbumWrapper2()
|
||||||
|
|
||||||
val albumList: List<Album>
|
val albumList: List<Album>
|
||||||
@ -18,4 +19,5 @@ class GetAlbumList2Response(status: Status,
|
|||||||
|
|
||||||
@Suppress("NamingConventionViolation")
|
@Suppress("NamingConventionViolation")
|
||||||
private class AlbumWrapper2(
|
private class AlbumWrapper2(
|
||||||
@JsonProperty("album") val albumList: List<Album> = emptyList())
|
@JsonProperty("album") val albumList: List<Album> = emptyList()
|
||||||
|
)
|
||||||
|
@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild
|
import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild
|
||||||
|
|
||||||
class GetAlbumListResponse(status: Status,
|
class GetAlbumListResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?)
|
error: SubsonicError?
|
||||||
: SubsonicResponse(status, version, error) {
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("albumList") private val albumWrapper = AlbumWrapper()
|
@JsonProperty("albumList") private val albumWrapper = AlbumWrapper()
|
||||||
|
|
||||||
val albumList: List<MusicDirectoryChild>
|
val albumList: List<MusicDirectoryChild>
|
||||||
@ -16,4 +17,5 @@ class GetAlbumListResponse(status: Status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class AlbumWrapper(
|
private class AlbumWrapper(
|
||||||
@JsonProperty("album") val albumList: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("album") val albumList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -4,7 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Album
|
import org.moire.ultrasonic.api.subsonic.models.Album
|
||||||
|
|
||||||
class GetAlbumResponse(status: Status,
|
class GetAlbumResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val album: Album = Album()) : SubsonicResponse(status, version, error)
|
val album: Album = Album()
|
||||||
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Artist
|
import org.moire.ultrasonic.api.subsonic.models.Artist
|
||||||
|
|
||||||
class GetArtistResponse(status: Status,
|
class GetArtistResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val artist: Artist = Artist())
|
val artist: Artist = Artist()
|
||||||
: SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -5,8 +5,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Indexes
|
import org.moire.ultrasonic.api.subsonic.models.Indexes
|
||||||
|
|
||||||
class GetArtistsResponse(status: Status,
|
class GetArtistsResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
@JsonProperty("artists") val indexes: Indexes = Indexes()) :
|
@JsonProperty("artists") val indexes: Indexes = Indexes()
|
||||||
SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Indexes
|
import org.moire.ultrasonic.api.subsonic.models.Indexes
|
||||||
|
|
||||||
class GetIndexesResponse(status: Status,
|
class GetIndexesResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val indexes: Indexes = Indexes()) :
|
val indexes: Indexes = Indexes()
|
||||||
SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Lyrics
|
import org.moire.ultrasonic.api.subsonic.models.Lyrics
|
||||||
|
|
||||||
class GetLyricsResponse(status: Status,
|
class GetLyricsResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val lyrics: Lyrics = Lyrics())
|
val lyrics: Lyrics = Lyrics()
|
||||||
: SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -5,9 +5,10 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.MusicDirectory
|
import org.moire.ultrasonic.api.subsonic.models.MusicDirectory
|
||||||
|
|
||||||
class GetMusicDirectoryResponse(status: Status,
|
class GetMusicDirectoryResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
@JsonProperty("directory")
|
@JsonProperty("directory")
|
||||||
val musicDirectory: MusicDirectory = MusicDirectory()) :
|
val musicDirectory: MusicDirectory = MusicDirectory()
|
||||||
SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -8,4 +8,5 @@ class GetPlaylistResponse(
|
|||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val playlist: Playlist = Playlist()) : SubsonicResponse(status, version, error)
|
val playlist: Playlist = Playlist()
|
||||||
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Playlist
|
import org.moire.ultrasonic.api.subsonic.models.Playlist
|
||||||
|
|
||||||
class GetPlaylistsResponse(status: Status,
|
class GetPlaylistsResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?)
|
error: SubsonicError?
|
||||||
: SubsonicResponse(status, version, error) {
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("playlists")
|
@JsonProperty("playlists")
|
||||||
private val playlistsWrapper: PlaylistsWrapper = PlaylistsWrapper()
|
private val playlistsWrapper: PlaylistsWrapper = PlaylistsWrapper()
|
||||||
|
|
||||||
@ -17,4 +18,5 @@ class GetPlaylistsResponse(status: Status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class PlaylistsWrapper(
|
private class PlaylistsWrapper(
|
||||||
@JsonProperty("playlist") val playlistList: List<Playlist> = emptyList())
|
@JsonProperty("playlist") val playlistList: List<Playlist> = emptyList()
|
||||||
|
)
|
||||||
|
@ -8,7 +8,8 @@ import org.moire.ultrasonic.api.subsonic.models.PodcastChannel
|
|||||||
class GetPodcastsResponse(
|
class GetPodcastsResponse(
|
||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) : SubsonicResponse(status, version, error) {
|
error: SubsonicError?
|
||||||
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("podcasts") private val channelsWrapper = PodcastChannelWrapper()
|
@JsonProperty("podcasts") private val channelsWrapper = PodcastChannelWrapper()
|
||||||
|
|
||||||
val podcastChannels: List<PodcastChannel>
|
val podcastChannels: List<PodcastChannel>
|
||||||
@ -16,4 +17,5 @@ class GetPodcastsResponse(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class PodcastChannelWrapper(
|
private class PodcastChannelWrapper(
|
||||||
@JsonProperty("channel") val channelsList: List<PodcastChannel> = emptyList())
|
@JsonProperty("channel") val channelsList: List<PodcastChannel> = emptyList()
|
||||||
|
)
|
||||||
|
@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild
|
import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild
|
||||||
|
|
||||||
class GetRandomSongsResponse(status: Status,
|
class GetRandomSongsResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?)
|
error: SubsonicError?
|
||||||
: SubsonicResponse(status, version, error) {
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("randomSongs") private val songsWrapper = RandomSongsWrapper()
|
@JsonProperty("randomSongs") private val songsWrapper = RandomSongsWrapper()
|
||||||
|
|
||||||
val songsList
|
val songsList
|
||||||
@ -16,4 +17,5 @@ class GetRandomSongsResponse(status: Status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class RandomSongsWrapper(
|
private class RandomSongsWrapper(
|
||||||
@JsonProperty("song") val songsList: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("song") val songsList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -8,11 +8,13 @@ import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild
|
|||||||
class GetSongsByGenreResponse(
|
class GetSongsByGenreResponse(
|
||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) : SubsonicResponse(status, version, error) {
|
error: SubsonicError?
|
||||||
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("songsByGenre") private val songsByGenreList = SongsByGenreWrapper()
|
@JsonProperty("songsByGenre") private val songsByGenreList = SongsByGenreWrapper()
|
||||||
|
|
||||||
val songsList get() = songsByGenreList.songsList
|
val songsList get() = songsByGenreList.songsList
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class SongsByGenreWrapper(
|
internal class SongsByGenreWrapper(
|
||||||
@JsonProperty("song") val songsList: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("song") val songsList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.SearchTwoResult
|
import org.moire.ultrasonic.api.subsonic.models.SearchTwoResult
|
||||||
|
|
||||||
class GetStarredResponse(status: Status,
|
class GetStarredResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val starred: SearchTwoResult = SearchTwoResult())
|
val starred: SearchTwoResult = SearchTwoResult()
|
||||||
: SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.SearchTwoResult
|
import org.moire.ultrasonic.api.subsonic.models.SearchTwoResult
|
||||||
|
|
||||||
class GetStarredTwoResponse(status: Status,
|
class GetStarredTwoResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val starred2: SearchTwoResult = SearchTwoResult())
|
val starred2: SearchTwoResult = SearchTwoResult()
|
||||||
: SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -8,4 +8,5 @@ class GetUserResponse(
|
|||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val user: User = User()) : SubsonicResponse(status, version, error)
|
val user: User = User()
|
||||||
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -5,11 +5,12 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.JukeboxStatus
|
import org.moire.ultrasonic.api.subsonic.models.JukeboxStatus
|
||||||
|
|
||||||
class JukeboxResponse(status: Status,
|
class JukeboxResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
var jukebox: JukeboxStatus = JukeboxStatus())
|
var jukebox: JukeboxStatus = JukeboxStatus()
|
||||||
: SubsonicResponse(status, version, error) {
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonSetter("jukeboxStatus") fun setJukeboxStatus(jukebox: JukeboxStatus) {
|
@JsonSetter("jukeboxStatus") fun setJukeboxStatus(jukebox: JukeboxStatus) {
|
||||||
this.jukebox = jukebox
|
this.jukebox = jukebox
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.License
|
import org.moire.ultrasonic.api.subsonic.models.License
|
||||||
|
|
||||||
class LicenseResponse(val license: License = License(),
|
class LicenseResponse(
|
||||||
|
val license: License = License(),
|
||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) :
|
error: SubsonicError?
|
||||||
SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -5,14 +5,16 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.MusicFolder
|
import org.moire.ultrasonic.api.subsonic.models.MusicFolder
|
||||||
|
|
||||||
class MusicFoldersResponse(status: Status,
|
class MusicFoldersResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) :
|
error: SubsonicError?
|
||||||
SubsonicResponse(status, version, error) {
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("musicFolders") private val wrapper = MusicFoldersWrapper()
|
@JsonProperty("musicFolders") private val wrapper = MusicFoldersWrapper()
|
||||||
|
|
||||||
val musicFolders get() = wrapper.musicFolders
|
val musicFolders get() = wrapper.musicFolders
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class MusicFoldersWrapper(
|
internal class MusicFoldersWrapper(
|
||||||
@JsonProperty("musicFolder") val musicFolders: List<MusicFolder> = emptyList())
|
@JsonProperty("musicFolder") val musicFolders: List<MusicFolder> = emptyList()
|
||||||
|
)
|
||||||
|
@ -4,8 +4,9 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.SearchResult
|
import org.moire.ultrasonic.api.subsonic.models.SearchResult
|
||||||
|
|
||||||
class SearchResponse(status: Status,
|
class SearchResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
val searchResult: SearchResult = SearchResult())
|
val searchResult: SearchResult = SearchResult()
|
||||||
: SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -9,5 +9,5 @@ class SearchThreeResponse(
|
|||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
@JsonProperty("searchResult3") val searchResult: SearchThreeResult = SearchThreeResult())
|
@JsonProperty("searchResult3") val searchResult: SearchThreeResult = SearchThreeResult()
|
||||||
: SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -9,5 +9,5 @@ class SearchTwoResponse(
|
|||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?,
|
error: SubsonicError?,
|
||||||
@JsonProperty("searchResult2") val searchResult: SearchTwoResult = SearchTwoResult())
|
@JsonProperty("searchResult2") val searchResult: SearchTwoResult = SearchTwoResult()
|
||||||
: SubsonicResponse(status, version, error)
|
) : SubsonicResponse(status, version, error)
|
||||||
|
@ -5,10 +5,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicAPIVersions
|
|||||||
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
import org.moire.ultrasonic.api.subsonic.SubsonicError
|
||||||
import org.moire.ultrasonic.api.subsonic.models.Share
|
import org.moire.ultrasonic.api.subsonic.models.Share
|
||||||
|
|
||||||
class SharesResponse(status: Status,
|
class SharesResponse(
|
||||||
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?)
|
error: SubsonicError?
|
||||||
: SubsonicResponse(status, version, error) {
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("shares") private val wrappedShares = SharesWrapper()
|
@JsonProperty("shares") private val wrappedShares = SharesWrapper()
|
||||||
|
|
||||||
val shares get() = wrappedShares.share
|
val shares get() = wrappedShares.share
|
||||||
|
@ -9,9 +9,11 @@ import java.io.InputStream
|
|||||||
*
|
*
|
||||||
* [responseHttpCode] will be there always.
|
* [responseHttpCode] will be there always.
|
||||||
*/
|
*/
|
||||||
class StreamResponse(val stream: InputStream? = null,
|
class StreamResponse(
|
||||||
|
val stream: InputStream? = null,
|
||||||
val apiError: SubsonicError? = null,
|
val apiError: SubsonicError? = null,
|
||||||
val responseHttpCode: Int) {
|
val responseHttpCode: Int
|
||||||
|
) {
|
||||||
/**
|
/**
|
||||||
* Check if this response has error.
|
* Check if this response has error.
|
||||||
*/
|
*/
|
||||||
|
@ -13,9 +13,11 @@ import org.moire.ultrasonic.api.subsonic.SubsonicError
|
|||||||
* Base Subsonic API response.
|
* Base Subsonic API response.
|
||||||
*/
|
*/
|
||||||
@JsonRootName(value = "subsonic-response")
|
@JsonRootName(value = "subsonic-response")
|
||||||
open class SubsonicResponse(val status: Status,
|
open class SubsonicResponse(
|
||||||
|
val status: Status,
|
||||||
val version: SubsonicAPIVersions,
|
val version: SubsonicAPIVersions,
|
||||||
val error: SubsonicError?) {
|
val error: SubsonicError?
|
||||||
|
) {
|
||||||
@JsonDeserialize(using = Status.Companion.StatusJsonDeserializer::class)
|
@JsonDeserialize(using = Status.Companion.StatusJsonDeserializer::class)
|
||||||
enum class Status(val jsonValue: String) {
|
enum class Status(val jsonValue: String) {
|
||||||
OK("ok"), ERROR("failed");
|
OK("ok"), ERROR("failed");
|
||||||
|
@ -8,11 +8,13 @@ import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild
|
|||||||
class VideosResponse(
|
class VideosResponse(
|
||||||
status: Status,
|
status: Status,
|
||||||
version: SubsonicAPIVersions,
|
version: SubsonicAPIVersions,
|
||||||
error: SubsonicError?) : SubsonicResponse(status, version, error) {
|
error: SubsonicError?
|
||||||
|
) : SubsonicResponse(status, version, error) {
|
||||||
@JsonProperty("videos") private val videosWrapper = VideosWrapper()
|
@JsonProperty("videos") private val videosWrapper = VideosWrapper()
|
||||||
|
|
||||||
val videosList: List<MusicDirectoryChild> get() = videosWrapper.videosList
|
val videosList: List<MusicDirectoryChild> get() = videosWrapper.videosList
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class VideosWrapper(
|
internal class VideosWrapper(
|
||||||
@JsonProperty("video") val videosList: List<MusicDirectoryChild> = emptyList())
|
@JsonProperty("video") val videosList: List<MusicDirectoryChild> = emptyList()
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user