Skip to content

Commit

Permalink
Enqueue.UPDATE_ACCORDINGLY action bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofrancis committed Jan 10, 2019
1 parent f18c31f commit f89dd5e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fetch2/src/main/java/com/tonyodev/fetch2/fetch/FetchHandlerImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ class FetchHandlerImpl(private val namespace: String,
} catch (e: Exception) {

}
} else if (existingDownload?.status == Status.COMPLETED
&& downloadInfo.enqueueAction == EnqueueAction.UPDATE_ACCORDINGLY) {
if (!storageResolver.fileExists(existingDownload.file)) {
try {
databaseManager.delete(existingDownload)
} catch (e: Exception) {
}
existingDownload = null
if (downloadInfo.enqueueAction != EnqueueAction.INCREMENT_FILE_NAME) {
storageResolver.createFile(downloadInfo.file)
}
}
}
}
return when (downloadInfo.enqueueAction) {
Expand Down

0 comments on commit f89dd5e

Please sign in to comment.