From 46b407bd9ac07429953e99ffe1361b916e46562f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 25 Jan 2024 09:51:55 -0500 Subject: [PATCH] feat: broadcast file if tus has the upload as well --- protocols/s5.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/protocols/s5.go b/protocols/s5.go index cd01811..efc624c 100644 --- a/protocols/s5.go +++ b/protocols/s5.go @@ -121,6 +121,13 @@ func (s S5ProviderStore) CanProvide(hash *encoding.Multihash, kind []types.Stora switch t { case types.StorageLocationTypeArchive, types.StorageLocationTypeFile, types.StorageLocationTypeFull: rawHash := hash.HashBytes() + + if exists, upload := s.proto.portal.Storage().TusUploadExists(rawHash); exists { + if upload.Completed { + return true + } + return false + } if exists, _ := s.proto.portal.Storage().FileExists(rawHash); exists { return true }