From 4020b9f7c7e8cf7bad2be63ae0bb762b842a0477 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 9 Mar 2024 14:27:07 -0500 Subject: [PATCH] fix: S5File::Exists needs to check tus before uploads --- api/s5/file.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/s5/file.go b/api/s5/file.go index 5ebddbc..a1ed73e 100644 --- a/api/s5/file.go +++ b/api/s5/file.go @@ -92,6 +92,13 @@ func NewFile(params FileParams) *S5File { } func (f *S5File) Exists() bool { + ctx := context.Background() + exists, _ := f.tus.UploadExists(ctx, f.hash) + + if exists { + return true + } + _, err := f.metadata.GetUpload(context.Background(), f.hash) if err != nil {