aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-09-11 13:34:46 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-09-11 13:34:46 -0700
commite33e02b026ef9ee0bb3865f3e1d92d16ba098b62 (patch)
tree67a8ae87479930e54f2bc92f11f927dca21fe02e /src
parent42f2e42fb4482928883768d1d1a600a1c8d45191 (diff)
downloaddsub-e33e02b026ef9ee0bb3865f3e1d92d16ba098b62.tar.gz
dsub-e33e02b026ef9ee0bb3865f3e1d92d16ba098b62.tar.bz2
dsub-e33e02b026ef9ee0bb3865f3e1d92d16ba098b62.zip
Possible fix for service dieing when partial is done downloading with StreamProxy
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/StreamProxy.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/StreamProxy.java b/src/github/daneren2005/dsub/service/StreamProxy.java
index 24c1b201..d1b5983c 100644
--- a/src/github/daneren2005/dsub/service/StreamProxy.java
+++ b/src/github/daneren2005/dsub/service/StreamProxy.java
@@ -220,6 +220,13 @@ public class StreamProxy implements Runnable {
Thread.sleep(1000);
}
}
+
+ // When done, switch .partial to .complete
+ // Make sure that it is in saveWhenDone mode, and currently playing
+ if(downloadFile.isWorkDone() && !downloadFile.isCompleteFileAvailable() && downloadFile.getPlaying()) {
+ downloadFile.setPlaying(false);
+ downloadFile.setPlaying(true);
+ }
} else {
Log.w(TAG, "Requesting data for completely downloaded file");
}