feat: broadcast file if tus has the upload as well

This commit is contained in:
Derrick Hammer 2024-01-25 09:51:55 -05:00
parent e1556f2f68
commit 46b407bd9a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 0 deletions

View File

@ -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
}