aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-09 21:29:49 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-09 21:29:49 -0700
commit4bc80103be097c22f360447756658267eb2943c0 (patch)
tree6c159bd02363879e9e2523eda34bea921eed8d1a /subsonic-android/src/github
parent9b81170e0bc2ffe6fa635e52563f4509546b0d26 (diff)
downloaddsub-4bc80103be097c22f360447756658267eb2943c0.tar.gz
dsub-4bc80103be097c22f360447756658267eb2943c0.tar.bz2
dsub-4bc80103be097c22f360447756658267eb2943c0.zip
Add song length total to album header
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 1e4bfc07..8cd66f5f 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -643,12 +643,17 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
int songCount = 0;
Set<String> artists = new HashSet<String>();
+ Integer totalDuration = 0;
for (MusicDirectory.Entry entry : entries) {
if (!entry.isDirectory()) {
songCount++;
if (entry.getArtist() != null) {
artists.add(entry.getArtist());
}
+ Integer duration = entry.getDuration();
+ if(duration != null) {
+ totalDuration += duration;
+ }
}
}
@@ -663,6 +668,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
TextView songCountView = (TextView) header.findViewById(R.id.select_album_song_count);
String s = context.getResources().getQuantityString(R.plurals.select_album_n_songs, songCount, songCount);
songCountView.setText(s.toUpperCase());
+
+ TextView songLengthView = (TextView) header.findViewById(R.id.select_album_song_length);
+ songLengthView.setText(Util.formatDuration(totalDuration));
if(add) {
return header;