Include "album artist" when inserting items in the media provider.

Change-Id: Ic34e2d54557409866dc35c29ee397afdfe874762
This commit is contained in:
Marco Nelissen
2010-03-18 17:10:38 -07:00
parent b82ac6bf37
commit abc2819328
2 changed files with 12 additions and 1 deletions

View File

@@ -869,6 +869,13 @@ public final class MediaStore {
*/
public static final String ARTIST = "artist";
/**
* The artist credited for the album that contains the audio file
* <P>Type: TEXT</P>
* @hide
*/
public static final String ALBUM_ARTIST = "album_artist";
/**
* A non human readable key calculated from the ARTIST, used for
* searching, sorting and grouping

View File

@@ -634,7 +634,11 @@ public class MediaScanner
} else if (MediaFile.isImageFileType(mFileType)) {
// FIXME - add DESCRIPTION
} else if (MediaFile.isAudioFileType(mFileType)) {
map.put(Audio.Media.ARTIST, (mArtist != null && mArtist.length() > 0 ? mArtist : MediaStore.UNKNOWN_STRING));
String artist = mArtist != null && mArtist.length() > 0 ?
mArtist : MediaStore.UNKNOWN_STRING;
map.put(Audio.Media.ARTIST, artist);
map.put(Audio.Media.ALBUM_ARTIST, mAlbumArtist != null &&
mAlbumArtist.length() > 0 ? mAlbumArtist : artist);
map.put(Audio.Media.ALBUM, (mAlbum != null && mAlbum.length() > 0 ? mAlbum : MediaStore.UNKNOWN_STRING));
map.put(Audio.Media.COMPOSER, mComposer);
if (mYear != 0) {