mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-02 23:43:37 +00:00
Rewriting classes in kotlin
This commit is contained in:
@@ -218,29 +218,6 @@ public class AlbumRepository {
|
||||
return album;
|
||||
}
|
||||
|
||||
public MutableLiveData<Album> getAlbumInfo(String id) {
|
||||
MutableLiveData<Album> album = new MutableLiveData<>();
|
||||
|
||||
App.getSubsonicClientInstance(application, false)
|
||||
.getBrowsingClient()
|
||||
.getAlbumInfo2(id)
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<SubsonicResponse> call, @NonNull Response<SubsonicResponse> response) {
|
||||
if (response.isSuccessful() && response.body() != null && response.body().getAlbumInfo() != null) {
|
||||
album.setValue(MappingUtil.mapAlbum(response.body().getAlbumInfo()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<SubsonicResponse> call, @NonNull Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return album;
|
||||
}
|
||||
|
||||
public void getInstantMix(Album album, int count, MediaCallback callback) {
|
||||
App.getSubsonicClientInstance(application, false)
|
||||
.getBrowsingClient()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cappielloantonio.play.repository;
|
||||
|
||||
import android.app.Application;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LiveData;
|
||||
@@ -108,12 +109,12 @@ public class PlaylistRepository {
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<SubsonicResponse> call, @NonNull Response<SubsonicResponse> response) {
|
||||
|
||||
Log.d("PLAYLIST", response.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<SubsonicResponse> call, @NonNull Throwable t) {
|
||||
|
||||
Log.d("PLAYLIST", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user