[Android] Store no AlbumArtist as null, for performance
Geoffrey Métais
git at videolan.org
Mon Dec 29 12:30:53 CET 2014
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Dec 29 12:24:45 2014 +0100| [0e2399ad396056898ab353e4358eac7d4640d292] | committer: Geoffrey Métais
Store no AlbumArtist as null, for performance
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0e2399ad396056898ab353e4358eac7d4640d292
---
libvlc/src/org/videolan/libvlc/Media.java | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index 8dd0b0f..6aca801 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -189,7 +189,7 @@ public class Media implements Comparable<Media> {
mArtist = getValueWrapper(track.Artist, UnknownStringType.Artist).trim();
mAlbum = getValueWrapper(track.Album, UnknownStringType.Album).trim();
mGenre = getValueWrapper(track.Genre, UnknownStringType.Genre).trim();
- mAlbumArtist = getValueWrapper(track.AlbumArtist, UnknownStringType.AlbumArtist).trim();
+ mAlbumArtist = track.AlbumArtist;
mArtworkURL = track.ArtworkURL;
mNowPlaying = track.NowPlaying;
if (!TextUtils.isEmpty(track.TrackNumber)) {
@@ -237,7 +237,7 @@ public class Media implements Comparable<Media> {
mArtist = getValueWrapper(artist, UnknownStringType.Artist);
mGenre = getValueWrapper(genre, UnknownStringType.Genre);
mAlbum = getValueWrapper(album, UnknownStringType.Album);
- mAlbumArtist = getValueWrapper(albumArtist, UnknownStringType.AlbumArtist);
+ mAlbumArtist = albumArtist;
mArtworkURL = artworkURL;
mTrackNumber = trackNumber;
}
@@ -425,20 +425,13 @@ public class Media implements Comparable<Media> {
}
public String getReferenceArtist() {
- if (isAlbumArtistUnknown())
- return mArtist;
- else
- return mAlbumArtist;
+ return mAlbumArtist == null ? mArtist : mAlbumArtist;
}
public String getArtist() {
return mArtist;
}
- public Boolean isAlbumArtistUnknown() {
- return (mAlbumArtist.equals(getValueWrapper(null, UnknownStringType.AlbumArtist)));
- }
-
public Boolean isArtistUnknown() {
return (mArtist.equals(getValueWrapper(null, UnknownStringType.Artist)));
}
More information about the Android
mailing list