1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Removed useless check for livestreams

This commit is contained in:
litetex 2021-09-25 00:04:53 +02:00
parent ba0876b43b
commit bbc13756f3

View File

@ -150,10 +150,10 @@ public class MediaSessionManager {
return true; return true;
} }
// Check if the current metadata is valid // Check if the currently set metadata is valid
if (getMetadataTitle() == null if (getMetadataTitle() == null
|| getMetadataArtist() == null || getMetadataArtist() == null
|| getMetadataDuration() <= 1 // Note that the duration can be <= 0 for live streams
) { ) {
if (DEBUG) { if (DEBUG) {
if (getMetadataTitle() == null) { if (getMetadataTitle() == null) {
@ -162,9 +162,6 @@ public class MediaSessionManager {
} else if (getMetadataArtist() == null) { } else if (getMetadataArtist() == null) {
Log.d(TAG, Log.d(TAG,
"N_getMetadataArtist: artist == null"); "N_getMetadataArtist: artist == null");
} else if (getMetadataDuration() <= 1) {
Log.d(TAG,
"N_getMetadataDuration: duration <= 1; " + getMetadataDuration());
} }
} }
return true; return true;
@ -200,11 +197,6 @@ public class MediaSessionManager {
.getString(MediaMetadataCompat.METADATA_KEY_ARTIST); .getString(MediaMetadataCompat.METADATA_KEY_ARTIST);
} }
private long getMetadataDuration() {
return mediaSession.getController().getMetadata()
.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
}
/** /**
* Should be called on player destruction to prevent leakage. * Should be called on player destruction to prevent leakage.
*/ */