diff --git a/app/src/main/java/org/schabi/newpipe/local/history/HistoryRecordManager.java b/app/src/main/java/org/schabi/newpipe/local/history/HistoryRecordManager.java index 823e56d9e4e..d8c8440e2ea 100644 --- a/app/src/main/java/org/schabi/newpipe/local/history/HistoryRecordManager.java +++ b/app/src/main/java/org/schabi/newpipe/local/history/HistoryRecordManager.java @@ -334,9 +334,9 @@ public Single> loadStreamStateBatch(final List .getState(entities.get(0).getUid()).blockingFirst(); if (states.isEmpty()) { result.add(null); - continue; + } else { + result.add(states.get(0)); } - result.add(states.get(0)); } return result; }).subscribeOn(Schedulers.io()); @@ -362,9 +362,9 @@ public Single> loadLocalStreamStateBatch( .blockingFirst(); if (states.isEmpty()) { result.add(null); - continue; + } else { + result.add(states.get(0)); } - result.add(states.get(0)); } return result; }).subscribeOn(Schedulers.io()); diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/MediaSessionManager.java b/app/src/main/java/org/schabi/newpipe/player/helper/MediaSessionManager.java index ef0d8402934..8d344c87788 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/MediaSessionManager.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/MediaSessionManager.java @@ -179,9 +179,7 @@ private boolean checkIfMetadataShouldBeSet( // If we got an album art check if the current set AlbumArt is null if (optAlbumArt.isPresent() && getMetadataAlbumArt() == null) { if (DEBUG) { - if (getMetadataAlbumArt() == null) { - Log.d(TAG, "N_getMetadataAlbumArt: thumb == null"); - } + Log.d(TAG, "N_getMetadataAlbumArt: thumb == null"); } return true; } @@ -191,16 +189,19 @@ private boolean checkIfMetadataShouldBeSet( } + @Nullable private Bitmap getMetadataAlbumArt() { return mediaSession.getController().getMetadata() .getBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART); } + @Nullable private String getMetadataTitle() { return mediaSession.getController().getMetadata() .getString(MediaMetadataCompat.METADATA_KEY_TITLE); } + @Nullable private String getMetadataArtist() { return mediaSession.getController().getMetadata() .getString(MediaMetadataCompat.METADATA_KEY_ARTIST);