Merge pull request #937 from TomHennen/fix936_delete

set autodownload == false once an item is downloaded
This commit is contained in:
Tom Hennen 2015-06-25 18:55:55 -04:00
commit e8c4d59efb
1 changed files with 9 additions and 5 deletions

View File

@ -1172,12 +1172,16 @@ public class DownloadService extends Service {
}
try {
if (chaptersRead) {
DBWriter.setFeedItem(DownloadService.this, media.getItem()).get();
}
// we've received the media, we don't want to autodownload it again
FeedItem item = media.getItem();
item.setAutoDownload(false);
// update the db
DBWriter.setFeedItem(DownloadService.this, item).get();
DBWriter.setFeedMedia(DownloadService.this, media).get();
if (!DBTasks.isInQueue(DownloadService.this, media.getItem().getId())) {
DBWriter.addQueueItem(DownloadService.this, media.getItem().getId()).get();
if (!DBTasks.isInQueue(DownloadService.this, item.getId())) {
DBWriter.addQueueItem(DownloadService.this, item.getId()).get();
}
} catch (ExecutionException e) {
e.printStackTrace();