DownloadService: We don't download images ourselves anymore
This commit is contained in:
parent
5c49dabf94
commit
252a0e218e
|
@ -613,14 +613,6 @@ public class DownloadService extends Service {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Is called whenever a Feed-Image is downloaded
|
||||
*/
|
||||
private void handleCompletedImageDownload(DownloadStatus status, DownloadRequest request) {
|
||||
Log.d(TAG, "Handling completed Image Download");
|
||||
syncExecutor.execute(new ImageHandlerThread(status, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* Is called whenever a FeedMedia is downloaded.
|
||||
*/
|
||||
|
@ -1017,39 +1009,6 @@ public class DownloadService extends Service {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a completed image download.
|
||||
*/
|
||||
class ImageHandlerThread implements Runnable {
|
||||
|
||||
private DownloadRequest request;
|
||||
private DownloadStatus status;
|
||||
|
||||
public ImageHandlerThread(DownloadStatus status, DownloadRequest request) {
|
||||
Validate.notNull(status);
|
||||
Validate.notNull(request);
|
||||
|
||||
this.status = status;
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
FeedImage image = DBReader.getFeedImage(request.getFeedfileId());
|
||||
if (image == null) {
|
||||
throw new IllegalStateException("Could not find downloaded image in database");
|
||||
}
|
||||
|
||||
image.setFile_url(request.getDestination());
|
||||
image.setDownloaded(true);
|
||||
|
||||
saveDownloadStatus(status);
|
||||
DBWriter.setFeedImage(image);
|
||||
numberOfDownloads.decrementAndGet();
|
||||
queryDownloadsAsync();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a completed media download.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue