From 7d277c55af2defb1d08ef882d7ac8c80a1c4cee3 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 18 Mar 2014 19:13:06 -0700 Subject: Fix Show Artist for online songs in offline mode --- src/github/daneren2005/dsub/fragments/DownloadFragment.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java index 198cc9d2..9f2b10a9 100644 --- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java +++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java @@ -600,15 +600,20 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe if(Util.isOffline(context)) { try { - // This should only be succesful if this is a online song in offline mode + // This should only be successful if this is a online song in offline mode Integer.parseInt(entry.getParent()); String root = FileUtil.getMusicDirectory(context).getPath(); String id = root + "/" + entry.getPath(); id = id.substring(0, id.lastIndexOf("/")); - intent.putExtra(Constants.INTENT_EXTRA_NAME_ID, id); + if(menuItemId == R.id.menu_show_album) { + intent.putExtra(Constants.INTENT_EXTRA_NAME_ID, id); + } id = id.substring(0, id.lastIndexOf("/")); - intent.putExtra(Constants.INTENT_EXTRA_NAME_PARENT_ID, id); - intent.putExtra(Constants.INTENT_EXTRA_NAME_PARENT_NAME, entry.getArtist()); + if(menuItemId != R.id.menu_show_album) { + intent.putExtra(Constants.INTENT_EXTRA_NAME_ID, id); + intent.putExtra(Constants.INTENT_EXTRA_NAME_NAME, entry.getArtist()); + intent.removeExtra(Constants.INTENT_EXTRA_NAME_CHILD_ID); + } } catch(Exception e) { // Do nothing, entry.getParent() is fine } -- cgit v1.2.3