mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Download manager improvements
This commit is contained in:
@@ -605,7 +605,15 @@ final class MediaBoxPartialFile {
|
||||
if let truncationSize = self.fileMap.truncationSize, self.fileMap.sum == truncationSize {
|
||||
status = .Local
|
||||
} else {
|
||||
status = .Remote
|
||||
let progress: Float
|
||||
if let truncationSize = self.fileMap.truncationSize, truncationSize != 0 {
|
||||
progress = Float(self.fileMap.sum) / Float(truncationSize)
|
||||
} else if let size = size {
|
||||
progress = Float(self.fileMap.sum) / Float(size)
|
||||
} else {
|
||||
progress = self.fileMap.progress ?? 0.0
|
||||
}
|
||||
status = .Remote(progress: progress)
|
||||
}
|
||||
} else {
|
||||
let progress: Float
|
||||
|
||||
Reference in New Issue
Block a user