Skip to content

Commit

Permalink
Insert artist name on column MediaStore.Audio.Media.ALBUM_ARTIST too
Browse files Browse the repository at this point in the history
  • Loading branch information
lalbuquerque committed Oct 17, 2020
1 parent c62f23b commit c4e60a5
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -635,17 +635,15 @@ private void addMediaToGallery(String fileName, String filePath, String contentT
values.put(MediaStore.Audio.Media.DATA, filePath);
values.put(MediaStore.Audio.Media.SIZE, file.getTotalSpace());

if (argMusicArtist != null) {
values.put(MediaStore.Audio.Media.ARTIST, argMusicArtist);
}

if (argMusicAlbum != null) {
values.put(MediaStore.Audio.Media.ALBUM, argMusicAlbum);
}

if (argSMExtras != null) {
values.put(MediaStore.Audio.Media.BOOKMARK, argSMExtras);
}
values.put(MediaStore.Audio.Media.ARTIST, argMusicArtist);
values.put(MediaStore.Audio.Media.ALBUM, argMusicAlbum);
values.put(MediaStore.Audio.Media.BOOKMARK, argSMExtras);

// For reasons I could not understand, Android SDK is failing to find the
// constant MediaStore.Audio.Media.ALBUM_ARTIST in pre-compilation time and
// obligated me to reference the column string value.
// However it's working just fine.
values.put("album_artist", argMusicArtist);

values.put(IS_PENDING, 1);
log("insert " + values + " to MediaStore");
Expand Down

0 comments on commit c4e60a5

Please sign in to comment.