diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-12-03 22:25:22 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-12-03 22:25:22 -0800 |
commit | fc22b1f1427ea02edd9e8e0250e526b9c7b744ec (patch) | |
tree | 1d6d7ef9095c6843315010cc35db45f2f6934942 /subsonic-android/src | |
parent | a3bddec3296d684b7d66ccd96478cec4fa870f18 (diff) | |
download | dsub-fc22b1f1427ea02edd9e8e0250e526b9c7b744ec.tar.gz dsub-fc22b1f1427ea02edd9e8e0250e526b9c7b744ec.tar.bz2 dsub-fc22b1f1427ea02edd9e8e0250e526b9c7b744ec.zip |
Visual fix for when file finishes downloading while still playing
Diffstat (limited to 'subsonic-android/src')
3 files changed, 6 insertions, 6 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java index 484ec548..d91395c0 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java @@ -125,7 +125,7 @@ public class DownloadFile { } public synchronized boolean isWorkDone() { - return saveFile.exists() || (completeFile.exists() && !save); + return saveFile.exists() || (completeFile.exists() && !save) || saveWhenDone || completeWhenDone; } public synchronized boolean isDownloading() { @@ -304,7 +304,8 @@ public class DownloadFile { if (wifiLock != null) { wifiLock.release(); } - new CacheCleaner(context, DownloadServiceImpl.getInstance()).clean(); + // TODO: Separate into cleanup space and full cleanup + // new CacheCleaner(context, DownloadServiceImpl.getInstance()).clean(); } } diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index a1c81cb4..b5670bed 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -365,7 +365,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { for (DownloadFile downloadFile : downloadList) { if (downloadFile.getSong().equals(song) && ((downloadFile.isDownloading() && !downloadFile.isDownloadCancelled() && downloadFile.getPartialFile().exists()) - || downloadFile.getCompleteFile().exists())) { + || downloadFile.isWorkDone())) { return downloadFile; } } diff --git a/subsonic-android/src/github/daneren2005/dsub/view/SongView.java b/subsonic-android/src/github/daneren2005/dsub/view/SongView.java index 98ceebba..582cc88c 100644 --- a/subsonic-android/src/github/daneren2005/dsub/view/SongView.java +++ b/subsonic-android/src/github/daneren2005/dsub/view/SongView.java @@ -112,14 +112,13 @@ public class SongView extends UpdateView implements Checkable { } DownloadFile downloadFile = downloadService.forSong(song); - File completeFile = downloadFile.getCompleteFile(); File partialFile = downloadFile.getPartialFile(); int leftImage = 0; int rightImage = 0; - if (completeFile.exists()) { - leftImage = downloadFile.isSaved() ? R.drawable.saved : R.drawable.downloaded; + if (downloadFile.isWorkDone()) { + leftImage = downloadFile.shouldSave() ? R.drawable.saved : R.drawable.downloaded; } if (downloadFile.isDownloading() && !downloadFile.isDownloadCancelled() && partialFile.exists()) { |