Reformatted MediaSessionManager code
This commit is contained in:
parent
c0d41661e8
commit
ba0876b43b
|
@ -93,7 +93,13 @@ public class MediaSessionManager {
|
|||
return;
|
||||
}
|
||||
|
||||
if (checkIfMetadataShouldBeSet(title, artist, optAlbumArt, duration)) {
|
||||
if (!checkIfMetadataShouldBeSet(title, artist, optAlbumArt, duration)) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "setMetadata: No update required");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "setMetadata: N_Metadata update:"
|
||||
+ " t: " + title
|
||||
|
@ -124,7 +130,6 @@ public class MediaSessionManager {
|
|||
lastAlbumArtHashCode = optAlbumArt.get().hashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkIfMetadataShouldBeSet(
|
||||
@NonNull final String title,
|
||||
|
@ -144,6 +149,7 @@ public class MediaSessionManager {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the current metadata is valid
|
||||
if (getMetadataTitle() == null
|
||||
|| getMetadataArtist() == null
|
||||
|
@ -163,6 +169,7 @@ public class MediaSessionManager {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we got an album art check if the current set AlbumArt is null
|
||||
if (optAlbumArt.isPresent() && getMetadataAlbumArt() == null) {
|
||||
if (DEBUG) {
|
||||
|
|
Loading…
Reference in New Issue