diff options
author | owner <owner@DeeDee-Laptop> | 2012-11-23 10:23:34 -0800 |
---|---|---|
committer | owner <owner@DeeDee-Laptop> | 2012-11-23 10:23:34 -0800 |
commit | 428f305bd8e9e1b370b13c5ec65ffefe3090e5d9 (patch) | |
tree | aa5e23dc1675bf479baa4f450e9432210e99afb1 /subsonic-android | |
parent | cabad9f498dd39e86869a39df95ca24552cefb1b (diff) | |
download | dsub-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.xml | 1 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java | 13 |
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) { |