mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +00:00
Rewriting classes in kotlin
This commit is contained in:
parent
74ec37cb5e
commit
103cd308de
43 changed files with 818 additions and 2325 deletions
|
|
@ -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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue