mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-11-04 09:13:00 +00:00 
			
		
		
		
	Merge pull request #7220 from TeamNewPipe/code-improvements
Simplify code and add annotations
This commit is contained in:
		@@ -334,9 +334,9 @@ public class HistoryRecordManager {
 | 
			
		||||
                        .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 class HistoryRecordManager {
 | 
			
		||||
                        .blockingFirst();
 | 
			
		||||
                if (states.isEmpty()) {
 | 
			
		||||
                    result.add(null);
 | 
			
		||||
                    continue;
 | 
			
		||||
                } else {
 | 
			
		||||
                    result.add(states.get(0));
 | 
			
		||||
                }
 | 
			
		||||
                result.add(states.get(0));
 | 
			
		||||
            }
 | 
			
		||||
            return result;
 | 
			
		||||
        }).subscribeOn(Schedulers.io());
 | 
			
		||||
 
 | 
			
		||||
@@ -179,9 +179,7 @@ public class MediaSessionManager {
 | 
			
		||||
        // 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 @@ public class MediaSessionManager {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user