From 2f0c0b210cb12e7d7b7cb50c10e7c9e78f23d66f Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 9 Sep 2015 09:05:47 -0700 Subject: Add album for song search results --- .../daneren2005/dsub/provider/DSubSearchProvider.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/github') diff --git a/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java b/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java index 63bbaaa4..f91c364e 100644 --- a/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java +++ b/app/src/main/java/github/daneren2005/dsub/provider/DSubSearchProvider.java @@ -156,7 +156,21 @@ public class DSubSearchProvider extends ContentProvider { } else { id = entry.getParent(); } - cursor.addRow(new Object[]{entry.getId().hashCode(), entry.getTitle(), entry.getArtist(), "so-" + id, entry.getTitle(), icon}); + + String artistDisplay; + if(entry.getArtist() == null) { + if(entry.getAlbum() != null) { + artistDisplay = entry.getAlbumDisplay(); + } else { + artistDisplay = ""; + } + } else if(entry.getAlbum() != null) { + artistDisplay = entry.getArtist() + " - " + entry.getAlbumDisplay(); + } else { + artistDisplay = entry.getArtist(); + } + + cursor.addRow(new Object[]{entry.getId().hashCode(), entry.getTitle(), artistDisplay, "so-" + id, entry.getTitle(), icon}); } } } -- cgit v1.2.3