I am using Jaudiotagger 2.2.5 for an android music tagging app. I am able to change metadata like album name, artist name, genre etc. But no matter what I try I can't get the album art part working. I have exhausted all suggestions that I could find online, but nothing seems to work. Jaudiotagger itself lacks documentation nor is the developer very helpful answering such issues.
for(Song s : songlist){ //for each song in the album
File file = new File(artUri);
if(file.exists()) {
Artwork cover = ArtworkFactory.createArtworkFromFile(file);
tag.deleteArtworkField();
tag.createField(cover);
tag.setField(cover);
af.commit();
}
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
intent.setData(Uri.fromFile(f));
sendBroadcast(intent);
}
Additionally I am using another method to update the mediastore:
public void updateAlbumArtMediaStore(Context context, final long id, String art){
Uri uri = ContentUris.withAppendedId(Uri.parse("content://media/external/audio/albumart"), id);
context.getContentResolver().delete(uri,null, null);
ContentValues values = new ContentValues();
values.put("album_id", id);
values.put("_data", art);
Uri newuri = context.getContentResolver()
.insert(Uri.parse("content://media/external/audio/albumart"),
values);
if(newuri!=null){
Toast.makeText(AlbumTagEditorActivity.this, "UPDATED", Toast.LENGTH_LONG).show();
context.getContentResolver().notifyChange(uri, null);
}else{
Toast.makeText(AlbumTagEditorActivity.this, "FAILED", Toast.LENGTH_LONG).show();
}
}
But when I do this it only deletes the cover art.
Its been months since I am trying to get this right. Nothing I have tried ever worked.