From 6c0f43b2ff026c5de5ed84c66a10efb5094a7995 Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Sun, 20 Aug 2017 22:04:41 +0200 Subject: [PATCH 1/3] Add getAlbum api call. Signed-off-by: Yahor Berdnikau --- .../api/subsonic/SubsonicApiGetAlbumTest.kt | 66 +++ .../resources/get_album_ok.json | 379 ++++++++++++++++++ .../api/subsonic/SubsonicAPIDefinition.kt | 4 + .../ultrasonic/api/subsonic/models/Album.kt | 4 +- .../api/subsonic/response/GetAlbumResponse.kt | 10 + 5 files changed, 462 insertions(+), 1 deletion(-) create mode 100644 subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumTest.kt create mode 100644 subsonic-api/src/integrationTest/resources/get_album_ok.json create mode 100644 subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumResponse.kt 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 new file mode 100644 index 00000000..9850b07e --- /dev/null +++ b/subsonic-api/src/integrationTest/kotlin/org/moire/ultrasonic/api/subsonic/SubsonicApiGetAlbumTest.kt @@ -0,0 +1,66 @@ +package org.moire.ultrasonic.api.subsonic + +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.api.subsonic.models.MusicDirectoryChild + +/** + * Integration test for [SubsonicAPIClient] for getAlbum call. + */ +class SubsonicApiGetAlbumTest : SubsonicAPIClientTest() { + @Test + fun `Should parse error responce`() { + checkErrorCallParsed(mockWebServerRule, { + client.api.getAlbum(56L).execute() + }) + } + + @Test + fun `Should add id to request params`() { + mockWebServerRule.enqueueResponse("get_album_ok.json") + val id = 76L + client.api.getAlbum(id).execute() + + val request = mockWebServerRule.mockWebServer.takeRequest() + + request.requestLine `should contain` "id=$id" + } + + @Test + fun `Should parse ok response`() { + mockWebServerRule.enqueueResponse("get_album_ok.json") + + val response = client.api.getAlbum(512L).execute() + + assertResponseSuccessful(response) + with(response.body().album) { + id `should equal to` 618L + name `should equal to` "Black Ice" + artist `should equal to` "AC/DC" + artistId `should equal to` 362L + coverArt `should equal to` "al-618" + songCount `should equal to` 15 + duration `should 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 + songList[0] `should equal` MusicDirectoryChild(id = 6491L, parent = 6475L, isDir = false, + title = "Rock 'n' Roll Train", album = "Black Ice", artist = "AC/DC", + track = 1, year = 2008, genre = "Hard Rock", coverArt = "6475", size = 7205451, + contentType = "audio/mpeg", suffix = "mp3", duration = 261, bitRate = 219, + path = "AC_DC/Black Ice/01 Rock 'n' Roll Train.mp3", isVideo = false, + playCount = 0, discNumber = 1, created = parseDate("2016-10-23T15:31:20.000Z"), + albumId = 618L, artistId = 362L, type = "music") + songList[5] `should equal` MusicDirectoryChild(id = 6492L, parent = 6475L, isDir = false, + title = "Smash 'n' Grab", album = "Black Ice", artist = "AC/DC", track = 6, + year = 2008, genre = "Hard Rock", coverArt = "6475", size = 6697204, + contentType = "audio/mpeg", suffix = "mp3", duration = 246, bitRate = 216, + path = "AC_DC/Black Ice/06 Smash 'n' Grab.mp3", isVideo = false, playCount = 0, + discNumber = 1, created = parseDate("2016-10-23T15:31:20.000Z"), + albumId = 618L, artistId = 362L, type = "music") + } + } +} diff --git a/subsonic-api/src/integrationTest/resources/get_album_ok.json b/subsonic-api/src/integrationTest/resources/get_album_ok.json new file mode 100644 index 00000000..dd3e8722 --- /dev/null +++ b/subsonic-api/src/integrationTest/resources/get_album_ok.json @@ -0,0 +1,379 @@ +{ + "subsonic-response" : { + "status" : "ok", + "version" : "1.15.0", + "album" : { + "id" : "618", + "name" : "Black Ice", + "artist" : "AC/DC", + "artistId" : "362", + "coverArt" : "al-618", + "songCount" : 15, + "duration" : 3331, + "created" : "2016-10-23T15:31:22.000Z", + "year" : 2008, + "genre" : "Hard Rock", + "song" : [ { + "id" : "6491", + "parent" : "6475", + "isDir" : false, + "title" : "Rock 'n' Roll Train", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 1, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 7205451, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 261, + "bitRate" : 219, + "path" : "AC_DC/Black Ice/01 Rock 'n' Roll Train.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:20.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6500", + "parent" : "6475", + "isDir" : false, + "title" : "Skies on Fire", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 2, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 5634607, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 214, + "bitRate" : 209, + "path" : "AC_DC/Black Ice/02 Skies on Fire.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:22.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6496", + "parent" : "6475", + "isDir" : false, + "title" : "Big Jack", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 3, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 6274247, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 237, + "bitRate" : 211, + "path" : "AC_DC/Black Ice/03 Big Jack.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:22.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6488", + "parent" : "6475", + "isDir" : false, + "title" : "Anything Goes", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 4, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 5763074, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 202, + "bitRate" : 227, + "path" : "AC_DC/Black Ice/04 Anything Goes.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:20.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6501", + "parent" : "6475", + "isDir" : false, + "title" : "War Machine", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 5, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 4962101, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 189, + "bitRate" : 208, + "path" : "AC_DC/Black Ice/05 War Machine.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:20.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6492", + "parent" : "6475", + "isDir" : false, + "title" : "Smash 'n' Grab", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 6, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 6697204, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 246, + "bitRate" : 216, + "path" : "AC_DC/Black Ice/06 Smash 'n' Grab.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:20.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6499", + "parent" : "6475", + "isDir" : false, + "title" : "Spoilin' for a Fight", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 7, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 5481070, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 197, + "bitRate" : 222, + "path" : "AC_DC/Black Ice/07 Spoilin' for a Fight.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:21.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6487", + "parent" : "6475", + "isDir" : false, + "title" : "Wheels", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 8, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 5837241, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 208, + "bitRate" : 223, + "path" : "AC_DC/Black Ice/08 Wheels.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:22.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6495", + "parent" : "6475", + "isDir" : false, + "title" : "Decibel", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 9, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 5251982, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 213, + "bitRate" : 195, + "path" : "AC_DC/Black Ice/09 Decibel.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:19.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6494", + "parent" : "6475", + "isDir" : false, + "title" : "Stormy May Day", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 10, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 5105168, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 190, + "bitRate" : 214, + "path" : "AC_DC/Black Ice/10 Stormy May Day.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:20.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6493", + "parent" : "6475", + "isDir" : false, + "title" : "She Likes Rock 'n' Roll", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 11, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 6135766, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 232, + "bitRate" : 210, + "path" : "AC_DC/Black Ice/11 She Likes Rock 'n' Roll.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:22.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6497", + "parent" : "6475", + "isDir" : false, + "title" : "Money Made", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 12, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 6816386, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 255, + "bitRate" : 213, + "path" : "AC_DC/Black Ice/12 Money Made.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:21.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6489", + "parent" : "6475", + "isDir" : false, + "title" : "Rock 'n' Roll Dream", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 13, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 7486707, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 280, + "bitRate" : 212, + "path" : "AC_DC/Black Ice/13 Rock 'n' Roll Dream.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:20.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6498", + "parent" : "6475", + "isDir" : false, + "title" : "Rocking All the Way", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 14, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 4927026, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 202, + "bitRate" : 194, + "path" : "AC_DC/Black Ice/14 Rocking All the Way.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:22.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + }, { + "id" : "6490", + "parent" : "6475", + "isDir" : false, + "title" : "Black Ice", + "album" : "Black Ice", + "artist" : "AC/DC", + "track" : 15, + "year" : 2008, + "genre" : "Hard Rock", + "coverArt" : "6475", + "size" : 5192799, + "contentType" : "audio/mpeg", + "suffix" : "mp3", + "duration" : 205, + "bitRate" : 202, + "path" : "AC_DC/Black Ice/15 Black Ice.mp3", + "isVideo" : false, + "playCount" : 0, + "discNumber" : 1, + "created" : "2016-10-23T15:31:22.000Z", + "albumId" : "618", + "artistId" : "362", + "type" : "music" + } ] + } + } +} \ No newline at end of file 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 9de5cab4..e5a38a1c 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 @@ -1,5 +1,6 @@ package org.moire.ultrasonic.api.subsonic +import org.moire.ultrasonic.api.subsonic.response.GetAlbumResponse import org.moire.ultrasonic.api.subsonic.response.GetArtistResponse import org.moire.ultrasonic.api.subsonic.response.GetArtistsResponse import org.moire.ultrasonic.api.subsonic.response.GetIndexesResponse @@ -48,4 +49,7 @@ interface SubsonicAPIDefinition { @GET("getArtist.view") fun getArtist(@Query("id") id: Long): Call + + @GET("getAlbum.view") + fun getAlbum(@Query("id") id: Long): Call } 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 3471cb60..40119aaa 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 @@ -1,5 +1,6 @@ package org.moire.ultrasonic.api.subsonic.models +import com.fasterxml.jackson.annotation.JsonProperty import java.util.Calendar data class Album( @@ -12,4 +13,5 @@ data class Album( val duration: Int = 0, val created: Calendar? = null, val year: Int = 0, - val genre: String = "") + val genre: String = "", + @JsonProperty("song") val songList: 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 new file mode 100644 index 00000000..a5f07596 --- /dev/null +++ b/subsonic-api/src/main/kotlin/org/moire/ultrasonic/api/subsonic/response/GetAlbumResponse.kt @@ -0,0 +1,10 @@ +package org.moire.ultrasonic.api.subsonic.response + +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) From 03fbf3dbfe0c292f61fb4f69fc8eb204c2ff6bde Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Mon, 21 Aug 2017 21:27:39 +0200 Subject: [PATCH 2/3] Add mapping from subsonic api album entity to MusicDirectory domain entity. Signed-off-by: Yahor Berdnikau --- .../ultrasonic/data/SubsonicAPIConverter.kt | 8 ++++++-- .../moire/ultrasonic/data/APIConverterTest.kt | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/data/SubsonicAPIConverter.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/data/SubsonicAPIConverter.kt index d93b5272..3b4462ce 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/data/SubsonicAPIConverter.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/data/SubsonicAPIConverter.kt @@ -49,6 +49,10 @@ fun Album.toDomainEntity(): MusicDirectory.Entry = MusicDirectory.Entry().apply genre = this@toDomainEntity.genre } +fun Album.toMusicDirectoryDomainEntity(): MusicDirectory = MusicDirectory().apply { + addAll(this@toMusicDirectoryDomainEntity.songList.map { it.toDomainEntity() }) +} + fun MusicDirectoryChild.toDomainEntity(): MusicDirectory.Entry = MusicDirectory.Entry().apply { id = this@toDomainEntity.id.toString() parent = this@toDomainEntity.parent.toString() @@ -65,13 +69,13 @@ fun MusicDirectoryChild.toDomainEntity(): MusicDirectory.Entry = MusicDirectory. suffix = this@toDomainEntity.suffix transcodedContentType = this@toDomainEntity.transcodedContentType transcodedSuffix = this@toDomainEntity.transcodedSuffix - coverArt = this@toDomainEntity.coverArt.toString() + coverArt = this@toDomainEntity.coverArt size = this@toDomainEntity.size duration = this@toDomainEntity.duration bitRate = this@toDomainEntity.bitRate path = this@toDomainEntity.path setIsVideo(this@toDomainEntity.isVideo) - setCreated(this@toDomainEntity.created?.time) + created = this@toDomainEntity.created?.time starred = this@toDomainEntity.starred != null discNumber = this@toDomainEntity.discNumber type = this@toDomainEntity.type diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/data/APIConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/data/APIConverterTest.kt index b15e7456..029f061a 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/data/APIConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/data/APIConverterTest.kt @@ -176,6 +176,22 @@ class APIConverterTest { } } + @Test + fun `Should convert to MusicDirectory domain entity`() { + val entity = Album(id = 101L, name = "some-album", artist = "some-artist", artistId = 54L, + coverArt = "some-id", songCount = 10, duration = 456, + created = Calendar.getInstance(), year = 2022, genre = "Hard Rock", + songList = listOf(MusicDirectoryChild())) + + val convertedEntity = entity.toMusicDirectoryDomainEntity() + + with(convertedEntity) { + name `should equal` null + children.size `should equal to` entity.songList.size + children[0] `should equal` entity.songList[0].toDomainEntity() + } + } + private fun createMusicFolder(id: Long = 0, name: String = ""): MusicFolder = MusicFolder(id, name) From 2d8d98696c25f30402823ec9d1218ca98aaa8905 Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Mon, 21 Aug 2017 21:29:09 +0200 Subject: [PATCH 3/3] Use new getAlbum() subsonic api call. Signed-off-by: Yahor Berdnikau --- .../ultrasonic/service/RESTMusicService.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/service/RESTMusicService.java b/ultrasonic/src/main/java/org/moire/ultrasonic/service/RESTMusicService.java index d86542fe..f818fe6d 100644 --- a/ultrasonic/src/main/java/org/moire/ultrasonic/service/RESTMusicService.java +++ b/ultrasonic/src/main/java/org/moire/ultrasonic/service/RESTMusicService.java @@ -56,6 +56,7 @@ import org.apache.http.protocol.ExecutionContext; import org.apache.http.protocol.HttpContext; import org.moire.ultrasonic.R; import org.moire.ultrasonic.api.subsonic.SubsonicAPIClient; +import org.moire.ultrasonic.api.subsonic.response.GetAlbumResponse; import org.moire.ultrasonic.api.subsonic.response.GetArtistResponse; import org.moire.ultrasonic.api.subsonic.response.GetArtistsResponse; import org.moire.ultrasonic.api.subsonic.response.GetIndexesResponse; @@ -388,21 +389,23 @@ public class RESTMusicService implements MusicService return APIConverter.toMusicDirectoryDomainEntity(response.body().getArtist()); } - @Override - public MusicDirectory getAlbum(String id, String name, boolean refresh, Context context, ProgressListener progressListener) throws Exception - { - checkServerVersion(context, "1.8", "Album by ID3 tag not supported."); + @Override + public MusicDirectory getAlbum(String id, + String name, + boolean refresh, + Context context, + ProgressListener progressListener) throws Exception { + if (id == null) { + throw new IllegalArgumentException("Id argument is null!"); + } - Reader reader = getReader(context, progressListener, "getAlbum", null, "id", id); - try - { - return new MusicDirectoryParser(context).parse(name, reader, progressListener, true); - } - finally - { - Util.close(reader); - } - } + updateProgressListener(progressListener, R.string.parser_reading); + Response response = subsonicAPIClient.getApi() + .getAlbum(Long.valueOf(id)).execute(); + checkResponseSuccessful(response); + + return APIConverter.toMusicDirectoryDomainEntity(response.body().getAlbum()); + } @Override public SearchResult search(SearchCriteria criteria, Context context, ProgressListener progressListener) throws Exception