diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-06-24 21:10:41 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-06-24 21:10:41 -0700 |
commit | 706326a851bb3994f696788b56f641f0f3a15b9a (patch) | |
tree | 3470e7ffb902ed89859ddec698fed640bbee15b6 /subsonic-android | |
parent | 6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1 (diff) | |
download | dsub-706326a851bb3994f696788b56f641f0f3a15b9a.tar.gz dsub-706326a851bb3994f696788b56f641f0f3a15b9a.tar.bz2 dsub-706326a851bb3994f696788b56f641f0f3a15b9a.zip |
Parse album/artist if they are part of tags
Diffstat (limited to 'subsonic-android')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java | 8 |
1 files changed, 8 insertions, 0 deletions
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"); |