aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-01-08 21:23:04 -0800
committerScott Jackson <daneren2005@gmail.com>2013-01-08 21:23:04 -0800
commitb1a98f5f081cd02018f78783e1979d60a7468a02 (patch)
treec7a1ad84964b9c776a4b6bbc89faa0219f0cc186
parent9b94aebd0567292edd7c978b8ef874cf14766440 (diff)
downloaddsub-b1a98f5f081cd02018f78783e1979d60a7468a02.tar.gz
dsub-b1a98f5f081cd02018f78783e1979d60a7468a02.tar.bz2
dsub-b1a98f5f081cd02018f78783e1979d60a7468a02.zip
Change default video action: If file exists open it, otherwise open stream
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
index 84f9a748..6362f039 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
@@ -77,7 +77,11 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
intent.putExtra(Constants.INTENT_EXTRA_NAME_NAME, entry.getTitle());
Util.startActivityWithoutTransition(SelectAlbumActivity.this, intent);
} else if (entry.isVideo()) {
- playExternalPlayer(entry);
+ if(entryExists(entry)) {
+ playExternalPlayer(entry);
+ } else {
+ streamExternalPlayer(entry);
+ }
}
}
}
@@ -542,6 +546,11 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
getDownloadService().delete(songs);
}
}
+
+ private boolean entryExists(MusicDirectory.Entry entry) {
+ DownloadFile check = new DownloadFile(this, entry, false);
+ return check.isCompleteFileAvailable();
+ }
private void playWebView(MusicDirectory.Entry entry) {
Intent intent = new Intent(Intent.ACTION_VIEW);
@@ -550,8 +559,7 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
startActivity(intent);
}
private void playExternalPlayer(MusicDirectory.Entry entry) {
- DownloadFile check = new DownloadFile(this, entry, false);
- if(!check.isCompleteFileAvailable()) {
+ if(!entryExists(entry)) {
Util.toast(this, R.string.download_need_download);
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);