Commit 8bd9691c authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

usage file destionation

parent de08b6cb
......@@ -18,7 +18,9 @@ data class TourFileData(
var fileDownloadedSize: Long = 0L,
var tempTourTotalDiff: Long = 0L,
var isDownloaded: Boolean = false,
val fatalState: DownloadState? = null
val fatalState: DownloadState? = null,
var destination: String
) {
constructor(entity: FileEntity, junction: TourFileJunctionEntity) : this(
fileUrl = junction.file
......@@ -28,5 +30,6 @@ data class TourFileData(
, fileDownloadedSize = entity.downloadedSize
, tempTourTotalDiff = 0L
, isDownloaded = entity.isDownloaded
, destination = entity.destination
)
}
......@@ -333,7 +333,7 @@ class DownloadManagerService @Inject constructor(
if (model.fileDownloadedSize > 0)
header = hashMapOf(Pair("Range", "bytes=${model.fileDownloadedSize}-"))
api.downloadFile(model.fileUrl.revisionUri(), header)
api.downloadFile(model.destination, header)
.doOnError {
Timber.e(it)
setTourStatus(model.tourId, DownloadState.Crushed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment