diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-12-05 21:26:30 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-12-05 21:26:30 -0800 |
commit | f596288da657f695f0b7a57de714f98390788dbe (patch) | |
tree | 5b5f03292089f410a4d7a5c577309f5e711c87b2 | |
parent | 1e9153b147bacfa7c9a766ab729e9f8f467ea80a (diff) | |
download | dsub-f596288da657f695f0b7a57de714f98390788dbe.tar.gz dsub-f596288da657f695f0b7a57de714f98390788dbe.tar.bz2 dsub-f596288da657f695f0b7a57de714f98390788dbe.zip |
Fix detecting end of playback correctly
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 90cfd238..0a04394a 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -817,11 +817,9 @@ public class DownloadServiceImpl extends Service implements DownloadService { setPlayerState(COMPLETED); - // If COMPLETED and not playing partial file, we are *really" finished - // with the song and can move on to the next. - if (!file.equals(downloadFile.getPartialFile())) { + // If COMPLETED and file is completely cached + if (downloadFile.isWorkDone()) { onSongCompleted(); - return; } // If file is not completely downloaded, restart the playback from the current position. @@ -839,6 +837,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { } } + // 12-04 18:59:19.350 I/DownloadServiceImpl( 2761): Requesting restart from 0 of 261000 Log.i(TAG, "Requesting restart from " + pos + " of " + duration); reset(); bufferTask = new BufferTask(downloadFile, pos); |