diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-01-27 15:51:03 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-01-27 15:51:03 -0800 |
commit | 271cc713ae19f4acbb157f377e7d90780ebd17a7 (patch) | |
tree | ec95aaf8d2337deecf9ddfea182211b8ab2e3974 /src/github | |
parent | 7c085eef1c873eb167ccaec8150574d972de7d23 (diff) | |
download | dsub-271cc713ae19f4acbb157f377e7d90780ebd17a7.tar.gz dsub-271cc713ae19f4acbb157f377e7d90780ebd17a7.tar.bz2 dsub-271cc713ae19f4acbb157f377e7d90780ebd17a7.zip |
Add year to album header
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 7ab81dd0..65aeeb59 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -951,6 +951,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter int songCount = 0;
Set<String> artists = new HashSet<String>();
+ Set<Integer> years = new HashSet<Integer>();
Integer totalDuration = 0;
for (MusicDirectory.Entry entry : entries) {
if (!entry.isDirectory()) {
@@ -958,6 +959,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter if (entry.getArtist() != null) {
artists.add(entry.getArtist());
}
+ if(entry.getYear() != null) {
+ years.add(entry.getYear());
+ }
Integer duration = entry.getDuration();
if(duration != null) {
totalDuration += duration;
@@ -971,7 +975,11 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter artistView.setSingleLine(false);
artistView.setLines(5);
} else if (artists.size() == 1) {
- artistView.setText(artists.iterator().next());
+ String artistText = artists.iterator().next();
+ if(years.size() == 1) {
+ artistText += " - " + years.iterator().next();
+ }
+ artistView.setText(artistText);
artistView.setVisibility(View.VISIBLE);
} else {
artistView.setVisibility(View.GONE);
|