mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +00:00
Repository code cleanup
This commit is contained in:
parent
65f1a4a7e9
commit
7f7ba52119
5 changed files with 27 additions and 36 deletions
|
|
@ -3,7 +3,6 @@ package com.cappielloantonio.play.repository;
|
|||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.cappielloantonio.play.App;
|
||||
|
|
@ -11,15 +10,12 @@ import com.cappielloantonio.play.interfaces.DecadesCallback;
|
|||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.subsonic.models.ResponseStatus;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.util.MappingUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
|
@ -313,8 +309,7 @@ public class AlbumRepository {
|
|||
if (response.isSuccessful() && response.body() != null && response.body().getAlbumList2() != null) {
|
||||
if (response.body().getAlbumList2().getAlbums().size() > 0 && response.body().getAlbumList2().getAlbums().get(0) != null) {
|
||||
callback.onLoadYear(response.body().getAlbumList2().getAlbums().get(0).getYear());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
callback.onLoadYear(-1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@ import androidx.annotation.NonNull;
|
|||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.cappielloantonio.play.App;
|
||||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.subsonic.models.ResponseStatus;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.util.MappingUtil;
|
||||
|
||||
|
|
@ -42,8 +40,7 @@ public class PlaylistRepository {
|
|||
if (random) {
|
||||
Collections.shuffle(playlists);
|
||||
listLivePlaylists.setValue(playlists.subList(0, Math.min(playlists.size(), size)));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
listLivePlaylists.setValue(playlists);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@ public class SystemRepository {
|
|||
} else {
|
||||
callback.onError(new Exception("Empty response"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
callback.onError(new Exception(String.valueOf(response.code())));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue