wip: file retries

This commit is contained in:
erinn 2021-11-02 14:31:14 -07:00
parent fcc9d7148a
commit 777d564ca4
1 changed files with 8 additions and 1 deletions

9
lib.go
View File

@ -713,13 +713,20 @@ func c_CheckDownloadStatus(profilePtr *C.char, profileLen C.int, fileKeyPtr *C.c
func CheckDownloadStatus(profileOnion, fileKey string) {
profile := application.GetPeer(profileOnion)
if path, exists := profile.GetAttribute(attr.GetLocalScope(fileKey)); exists {
if path, exists := profile.GetAttribute(attr.GetLocalScope(fmt.Sprintf("%s.complete", fileKey))); exists {
eventHandler.Push(event.NewEvent(event.FileDownloaded, map[event.Field]string{
ProfileOnion: profileOnion,
event.FileKey: fileKey,
event.FilePath: path,
event.TempFile: "",
}))
} else if path, exists = profile.GetAttribute(attr.GetLocalScope(fmt.Sprintf("%s.path", fileKey))); exists {
eventHandler.Push(event.NewEvent(event.FileDownloadProgressUpdate, map[event.Field]string{
ProfileOnion: profileOnion,
event.FileKey: fileKey,
event.Progress: ??,
event.FileSizeInChunks: ??,
}))
}
}