From e57a7b929327736fbdce0f877920169c06df3d61 Mon Sep 17 00:00:00 2001 From: CappielloAntonio Date: Sat, 5 Feb 2022 18:37:59 +0100 Subject: [PATCH] Cleanup code --- .../cappielloantonio/play/repository/SongRepository.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/cappielloantonio/play/repository/SongRepository.java b/app/src/main/java/com/cappielloantonio/play/repository/SongRepository.java index a2558826..dfad2272 100644 --- a/app/src/main/java/com/cappielloantonio/play/repository/SongRepository.java +++ b/app/src/main/java/com/cappielloantonio/play/repository/SongRepository.java @@ -38,7 +38,7 @@ public class SongRepository { .enqueue(new Callback() { @Override public void onResponse(@NonNull Call call, @NonNull Response response) { - if(response.isSuccessful() && response.body() != null && response.body().getStarred2() != null) { + if (response.isSuccessful() && response.body() != null && response.body().getStarred2() != null) { List songs = new ArrayList<>(MappingUtil.mapSong(response.body().getStarred2().getSongs())); if (!random) { @@ -97,7 +97,7 @@ public class SongRepository { public void onResponse(@NonNull Call call, @NonNull Response response) { List songs = new ArrayList<>(); - if(response.isSuccessful() && response.body() != null && response.body().getRandomSongs() != null) { + if (response.isSuccessful() && response.body() != null && response.body().getRandomSongs() != null) { songs.addAll(MappingUtil.mapSong(response.body().getRandomSongs().getSongs())); } @@ -194,7 +194,7 @@ public class SongRepository { List newSongs = new ArrayList<>(MappingUtil.mapSong(response.body().getSongsByGenre().getSongs())); List songs = songsByGenre.getValue(); - if(songs == null) songs = new ArrayList<>(); + if (songs == null) songs = new ArrayList<>(); songs.addAll(newSongs); Collections.shuffle(songs); @@ -226,7 +226,7 @@ public class SongRepository { public void onResponse(@NonNull Call call, @NonNull Response response) { List songs = new ArrayList<>(); - if(response.isSuccessful() && response.body() != null && response.body().getSongsByGenre() != null) { + if (response.isSuccessful() && response.body() != null && response.body().getSongsByGenre() != null) { songs.addAll(MappingUtil.mapSong(response.body().getSongsByGenre().getSongs())); }