Failed downloads were not handled correctly

This commit is contained in:
daniel oeh 2012-08-18 16:11:16 +02:00
parent 095618855d
commit 88e544a6e6
2 changed files with 3 additions and 1 deletions

View File

@ -348,6 +348,8 @@ public class DownloadService extends Service {
&& reason != DownloadError.ERROR_DOWNLOAD_CANCELLED) { && reason != DownloadError.ERROR_DOWNLOAD_CANCELLED) {
Log.e(TAG, "Download failed"); Log.e(TAG, "Download failed");
} }
download.setFile_url(null);
download.setDownloaded(false);
saveDownloadStatus(status); saveDownloadStatus(status);
sendDownloadHandledIntent(getDownloadType(download)); sendDownloadHandledIntent(getDownloadType(download));

View File

@ -29,7 +29,7 @@ public class FeedItemMenuHandler {
if (selectedItem.getMedia().isDownloaded()) { if (selectedItem.getMedia().isDownloaded()) {
menu.findItem(R.id.play_item).setVisible(true); menu.findItem(R.id.play_item).setVisible(true);
menu.findItem(R.id.remove_item).setVisible(true); menu.findItem(R.id.remove_item).setVisible(true);
} else if (selectedItem.getMedia().getFile_url() == null) { } else {
menu.findItem(R.id.download_item).setVisible(true); menu.findItem(R.id.download_item).setVisible(true);
menu.findItem(R.id.stream_item).setVisible(true); menu.findItem(R.id.stream_item).setVisible(true);
} }