Download REST API endpoints (#72)

* backend and frontend hotfixes, see message

Improved rendering on the frontend by cutting unecessary useStates.
Backend side, downloads now auto resume even on application kill.

* download rest api endpoints, general code refactor

* download request json mappings
This commit is contained in:
Marco
2023-07-31 08:30:09 +02:00
committed by GitHub
parent 68c829c40e
commit 8327d1e94c
22 changed files with 560 additions and 300 deletions

View File

@@ -125,12 +125,18 @@ func (m *MemoryDB) Restore() {
}
for _, proc := range session.Processes {
m.table.Store(proc.Id, &Process{
restored := &Process{
Id: proc.Id,
Url: proc.Info.URL,
Info: proc.Info,
Progress: proc.Progress,
})
}
m.table.Store(proc.Id, restored)
if restored.Progress.Percentage != "-1" {
go restored.Start()
}
}
log.Println(cli.BgGreen, "Successfully restored session", cli.Reset)