aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-12-14 20:10:17 -0800
committerScott Jackson <daneren2005@gmail.com>2012-12-14 20:10:17 -0800
commit6571db53c69e594d658881e1ac1c7fc79b4828c8 (patch)
tree64d0633b64781c989de59cff4057f5fafaf5647b /subsonic-android/src/github
parentc28f908a1fab16ee9ac273a5fc226d5abc02ba01 (diff)
downloaddsub-6571db53c69e594d658881e1ac1c7fc79b4828c8.tar.gz
dsub-6571db53c69e594d658881e1ac1c7fc79b4828c8.tar.bz2
dsub-6571db53c69e594d658881e1ac1c7fc79b4828c8.zip
Added length to song details
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java3
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java2
2 files changed, 5 insertions, 0 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
index 6ef17a3b..105bb5c5 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
@@ -744,6 +744,9 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
if(song.getBitRate() != null && song.getBitRate() != 0) {
msg += "\nBitrate: " + song.getBitRate() + " kpbs";
}
+ if(song.getDuration() != null && song.getDuration() != 0) {
+ msg += "\nLength: " + Util.formatDuration(song.getDuration());
+ }
msg += "\nSize: " + Util.formatBytes(song.getSize());
new AlertDialog.Builder(this)
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
index d0b0f93c..33b406cb 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
@@ -131,6 +131,8 @@ public class OfflineMusicService extends RESTMusicService {
entry.setBitRate(Integer.parseInt((bitrate != null) ? bitrate : "0") / 1000);
String year = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_YEAR);
entry.setYear(Integer.parseInt((year != null) ? year : "0"));
+ String length = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
+ entry.setDuration(Integer.parseInt(length) / 1000);
} catch(Exception e) {
Log.i(TAG, "Device doesn't properly support MediaMetadataRetreiver");
}