aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-06-18 21:23:24 -0700
committerScott Jackson <daneren2005@gmail.com>2013-06-18 21:23:24 -0700
commit90da556bb175e31cf829911ad14bbc793cb1a216 (patch)
tree32050e8c325409fdeeb3184ee2948e18316610ea /subsonic-android/src
parent9ba93d8a887fac10bb385dc4f2004bbaf1637167 (diff)
downloaddsub-90da556bb175e31cf829911ad14bbc793cb1a216.tar.gz
dsub-90da556bb175e31cf829911ad14bbc793cb1a216.tar.bz2
dsub-90da556bb175e31cf829911ad14bbc793cb1a216.zip
Fix Show Album for online songs in offline mode
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 9bcb4a05..5b227f89 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -530,6 +530,23 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
intent.putExtra(Constants.INTENT_EXTRA_NAME_PARENT_ID, entry.getGrandParent());
intent.putExtra(Constants.INTENT_EXTRA_NAME_PARENT_NAME, entry.getArtist());
}
+
+ if(Util.isOffline(context)) {
+ try {
+ // This should only be succesful 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);
+ 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());
+ } catch(Exception e) {
+ // Do nothing, entry.getParent() is fine
+ }
+ }
+
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Util.startActivityWithoutTransition(context, intent);
return true;