diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-05-09 21:29:49 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-05-09 21:29:49 -0700 |
commit | 4bc80103be097c22f360447756658267eb2943c0 (patch) | |
tree | 6c159bd02363879e9e2523eda34bea921eed8d1a /subsonic-android/src/github | |
parent | 9b81170e0bc2ffe6fa635e52563f4509546b0d26 (diff) | |
download | dsub-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.java | 8 |
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;
|