Files
Adobe-Downloader/Adobe Downloader/Commons/Extensions.swift
X1a0He d3835005fb fix: Fix the issue with download tasks
1. Fixed the issue where after the task download is completed, the program will prompt that it has been paused when re-entering the program
2025-02-06 16:29:59 +08:00

22 lines
610 B
Swift

//
// Adobe Downloader
//
// Created by X1a0He on 2024/10/30.
//
import Foundation
import AppKit
extension NewDownloadTask {
var startTime: Date {
switch totalStatus {
case .downloading(let info): return info.startTime
case .completed(let info): return info.timestamp - info.totalTime
case .preparing(let info): return info.timestamp
case .paused(let info): return info.timestamp
case .failed(let info): return info.timestamp
case .retrying(let info): return info.nextRetryDate - 60
case .waiting, .none: return createAt
}
}
}