NewDownloadModel creates a new download model
(id string, url string, filename string, total int64)
| 242 | |
| 243 | // NewDownloadModel creates a new download model |
| 244 | func NewDownloadModel(id string, url string, filename string, total int64) *DownloadModel { |
| 245 | // Create dummy state container for compatibility if needed |
| 246 | state := types.NewProgressState(id, total) |
| 247 | return &DownloadModel{ |
| 248 | ID: id, |
| 249 | URL: url, |
| 250 | Filename: filename, |
| 251 | FilenameLower: strings.ToLower(filename), |
| 252 | Total: total, |
| 253 | StartTime: time.Now(), |
| 254 | progress: progress.New( |
| 255 | progress.WithSpringOptions(0.5, 0.1), |
| 256 | progress.WithColors(colors.ProgressStart(), colors.ProgressEnd()), |
| 257 | progress.WithScaled(true), |
| 258 | ), |
| 259 | state: state, |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | func InitialRootModel(serverPort int, currentVersion string, service core.DownloadService, orchestrator *processing.LifecycleManager, noResume bool, currentCommit ...string) RootModel { |
| 264 | initialDarkBackground := true |