From 706326a851bb3994f696788b56f641f0f3a15b9a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 24 Jun 2013 21:10:41 -0700 Subject: Parse album/artist if they are part of tags --- .../src/github/daneren2005/dsub/service/OfflineMusicService.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'subsonic-android') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java index 40c1cdb0..230b87d3 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -193,6 +193,14 @@ public class OfflineMusicService extends RESTMusicService { entry.setBitRate(Integer.parseInt((bitrate != null) ? bitrate : "0") / 1000); String length = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); entry.setDuration(Integer.parseInt(length) / 1000); + String artist = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST); + if(artist != null) { + entry.setArtist(artist); + } + String album = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM); + if(album != null) { + entry.setAlbum(album); + } metadata.release(); } catch(Exception e) { Log.i(TAG, "Device doesn't properly support MediaMetadataRetreiver"); -- cgit v1.2.3