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

usage file destionation

parent de08b6cb
...@@ -18,7 +18,9 @@ data class TourFileData( ...@@ -18,7 +18,9 @@ data class TourFileData(
var fileDownloadedSize: Long = 0L, var fileDownloadedSize: Long = 0L,
var tempTourTotalDiff: Long = 0L, var tempTourTotalDiff: Long = 0L,
var isDownloaded: Boolean = false, var isDownloaded: Boolean = false,
val fatalState: DownloadState? = null val fatalState: DownloadState? = null,
var destination: String
) { ) {
constructor(entity: FileEntity, junction: TourFileJunctionEntity) : this( constructor(entity: FileEntity, junction: TourFileJunctionEntity) : this(
fileUrl = junction.file fileUrl = junction.file
...@@ -28,5 +30,6 @@ data class TourFileData( ...@@ -28,5 +30,6 @@ data class TourFileData(
, fileDownloadedSize = entity.downloadedSize , fileDownloadedSize = entity.downloadedSize
, tempTourTotalDiff = 0L , tempTourTotalDiff = 0L
, isDownloaded = entity.isDownloaded , isDownloaded = entity.isDownloaded
, destination = entity.destination
) )
} }
...@@ -333,7 +333,7 @@ class DownloadManagerService @Inject constructor( ...@@ -333,7 +333,7 @@ class DownloadManagerService @Inject constructor(
if (model.fileDownloadedSize > 0) if (model.fileDownloadedSize > 0)
header = hashMapOf(Pair("Range", "bytes=${model.fileDownloadedSize}-")) header = hashMapOf(Pair("Range", "bytes=${model.fileDownloadedSize}-"))
api.downloadFile(model.fileUrl.revisionUri(), header) api.downloadFile(model.destination, header)
.doOnError { .doOnError {
Timber.e(it) Timber.e(it)
setTourStatus(model.tourId, DownloadState.Crushed) 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