aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java10
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);