mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 15:03:37 +00:00
fix: fixed a bug in the paginated song lists
This commit is contained in:
@@ -71,7 +71,11 @@ public class SongListPageViewModel extends AndroidViewModel {
|
||||
public void getSongsByPage(LifecycleOwner owner) {
|
||||
switch (title) {
|
||||
case Constants.MEDIA_BY_GENRE:
|
||||
int page = (songList.getValue() != null ? songList.getValue().size() : 0) / 100;
|
||||
int songCount = songList.getValue() != null ? songList.getValue().size() : 0;
|
||||
|
||||
if (songCount > 0 && songCount % 100 != 0) return;
|
||||
|
||||
int page = songCount / 100;
|
||||
songRepository.getSongsByGenre(genre.getGenre(), page).observe(owner, children -> {
|
||||
if (children != null && !children.isEmpty()) {
|
||||
List<Child> currentMedia = songList.getValue();
|
||||
|
||||
Reference in New Issue
Block a user