aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java6
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java3
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/SongView.java11
3 files changed, 19 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java
index b07d4731..e75a5104 100644
--- a/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java
+++ b/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java
@@ -44,6 +44,7 @@ public class EntryGridAdapter extends SectionAdapter<Entry> {
private ImageLoader imageLoader;
private boolean largeAlbums;
private boolean showArtist = false;
+ private boolean showAlbum = false;
private boolean removeFromPlaylist = false;
private View header;
@@ -87,6 +88,7 @@ public class EntryGridAdapter extends SectionAdapter<Entry> {
albumView.setObject(entry, imageLoader);
} else if(viewType == VIEW_TYPE_SONG) {
SongView songView = (SongView) view;
+ songView.setShowAlbum(showAlbum);
songView.setObject(entry, checkable && !entry.isVideo());
}
}
@@ -123,6 +125,10 @@ public class EntryGridAdapter extends SectionAdapter<Entry> {
this.showArtist = showArtist;
}
+ public void setShowAlbum(boolean showAlbum) {
+ this.showAlbum = showAlbum;
+ }
+
public void removeAt(int index) {
sections.get(0).remove(index);
if(header != null) {
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index df79d91f..de74d0ed 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -745,6 +745,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Section
if(!artist) {
entryGridAdapter.setShowArtist(true);
}
+ if(topTracks) {
+ entryGridAdapter.setShowAlbum(true);
+ }
// Show header if not album list type and not root and not artist
// For Subsonic 5.1+ display a header for artists with getArtistInfo data if it exists
diff --git a/app/src/main/java/github/daneren2005/dsub/view/SongView.java b/app/src/main/java/github/daneren2005/dsub/view/SongView.java
index 84e04a0b..8cb0c21c 100644
--- a/app/src/main/java/github/daneren2005/dsub/view/SongView.java
+++ b/app/src/main/java/github/daneren2005/dsub/view/SongView.java
@@ -71,6 +71,7 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
private boolean showPodcast = false;
private boolean isPlayed = false;
private boolean isPlayedShown = false;
+ private boolean showAlbum = false;
public SongView(Context context) {
super(context);
@@ -114,7 +115,11 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
}
}
else if(song.getArtist() != null) {
- artist.append(song.getArtist());
+ if(showAlbum) {
+ artist.append(song.getAlbum());
+ } else {
+ artist.append(song.getArtist());
+ }
}
if(isPodcast) {
@@ -354,4 +359,8 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
public void setShowPodcast(boolean showPodcast) {
this.showPodcast = showPodcast;
}
+
+ public void setShowAlbum(boolean showAlbum) {
+ this.showAlbum = showAlbum;
+ }
}