Commit 0e2399ad authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Store no AlbumArtist as null, for performance

parent e573597d
......@@ -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)));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment