aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorowner <owner@DeeDee-Laptop>2012-11-23 10:23:34 -0800
committerowner <owner@DeeDee-Laptop>2012-11-23 10:23:34 -0800
commit428f305bd8e9e1b370b13c5ec65ffefe3090e5d9 (patch)
treeaa5e23dc1675bf479baa4f450e9432210e99afb1 /subsonic-android
parentcabad9f498dd39e86869a39df95ca24552cefb1b (diff)
downloaddsub-428f305bd8e9e1b370b13c5ec65ffefe3090e5d9.tar.gz
dsub-428f305bd8e9e1b370b13c5ec65ffefe3090e5d9.tar.bz2
dsub-428f305bd8e9e1b370b13c5ec65ffefe3090e5d9.zip
Added error message if trying to play videos which haven't been downloaded yet
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/res/values/strings.xml1
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java13
2 files changed, 11 insertions, 3 deletions
diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml
index 531c84eb..12e93949 100644
--- a/subsonic-android/res/values/strings.xml
+++ b/subsonic-android/res/values/strings.xml
@@ -136,6 +136,7 @@
<string name="download.show_now_playing">Show Now Playing</string>
<string name="download.start_timer">Start Timer</string>
<string name="download.stop_timer">Stop Timer</string>
+ <string name="download.need_download">Video needs to be downloaded first</string>
<string name="starring_content_starred">Starred \"%s\"</string>
<string name="starring_content_unstarred">Unstarred \"%s\"</string>
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
index cd71db36..fea1cfd0 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
@@ -34,9 +34,11 @@ import android.widget.*;
import com.actionbarsherlock.view.Menu;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.MusicDirectory;
+import github.daneren2005.dsub.service.DownloadFile;
import github.daneren2005.dsub.service.MusicService;
import github.daneren2005.dsub.service.MusicServiceFactory;
import github.daneren2005.dsub.util.*;
+import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
@@ -502,9 +504,14 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
startActivity(intent);
}
private void playExternalPlayer(MusicDirectory.Entry entry) {
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setDataAndType(Uri.parse(entry.getPath()), "video/*");
- startActivity(intent);
+ DownloadFile check = new DownloadFile(this, entry, false);
+ if(!check.isCompleteFileAvailable()) {
+ Util.toast(this, R.string.download_need_download);
+ } else {
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setDataAndType(Uri.parse(entry.getPath()), "video/*");
+ startActivity(intent);
+ }
}
private void checkLicenseAndTrialPeriod(Runnable onValid) {