aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-01-21 10:28:06 -0800
committerScott Jackson <daneren2005@gmail.com>2015-01-21 10:28:06 -0800
commit38f386015e8a3cd8f2396cf3af24b1b7b1827645 (patch)
tree1c6f53e4bd03eac1a9aece53acfcc65fb1e09069
parentfb4f51023ed5ee704d5c105e168b043a727ddd2e (diff)
downloaddsub-38f386015e8a3cd8f2396cf3af24b1b7b1827645.tar.gz
dsub-38f386015e8a3cd8f2396cf3af24b1b7b1827645.tar.bz2
dsub-38f386015e8a3cd8f2396cf3af24b1b7b1827645.zip
#441 Fix artist lookup with tag browsing
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java2
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java5
-rw-r--r--src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java6
3 files changed, 10 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index e8f2b665..4b0fed21 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -513,7 +513,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
SelectDirectoryFragment.this.name = dir.getName();
} else if(id != null && directory == null && dir.getParent() != null) {
// View Album, try to lookup parent to get a complete entry to use for starring
- MusicDirectory parentDir = getMusicDirectory(dir.getParent(), name, refresh, service, this);
+ MusicDirectory parentDir = getMusicDirectory(dir.getParent(), name, refresh, true, service, this);
for(Entry child: parentDir.getChildren()) {
if(id.equals(child.getId())) {
directory = child;
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 5a190439..6128e4ee 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -943,8 +943,11 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
}
protected MusicDirectory getMusicDirectory(String id, String name, boolean refresh, MusicService service, ProgressListener listener) throws Exception {
+ return getMusicDirectory(id, name, refresh, false, service, listener);
+ }
+ protected MusicDirectory getMusicDirectory(String id, String name, boolean refresh, boolean forceArtist, MusicService service, ProgressListener listener) throws Exception {
if(Util.isTagBrowsing(context) && !Util.isOffline(context)) {
- if(artist && !artistOverride) {
+ if(artist && !artistOverride || forceArtist) {
return service.getArtist(id, name, refresh, context, listener);
} else {
return service.getAlbum(id, name, refresh, context, listener);
diff --git a/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java b/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
index a5500505..9e5b48b4 100644
--- a/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
+++ b/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
@@ -81,7 +81,11 @@ public class MusicDirectoryParser extends MusicDirectoryEntryParser {
} else if ("directory".equals(name) || "artist".equals(name) || ("album".equals(name) && !isArtist)) {
dir.setName(get("name"));
dir.setId(get("id"));
- dir.setParent(get("parent"));
+ if(Util.isTagBrowsing(context, instance)) {
+ dir.setParent(get("artistId"));
+ } else {
+ dir.setParent(get("parent"));
+ }
isArtist = true;
} else if("album".equals(name)) {
Entry entry = parseEntry(artist);