Rewriting classes in kotlin

This commit is contained in:
antonio 2023-03-02 10:48:30 +01:00
parent 74ec37cb5e
commit 103cd308de
43 changed files with 818 additions and 2325 deletions

View file

@ -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()

View file

@ -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());
}
});
}