Feat: create hidden file when creating upload session

This commit is contained in:
HFO4
2022-02-27 14:04:30 +08:00
parent 868a88e5fc
commit e37e93a7b6
11 changed files with 69 additions and 74 deletions

View File

@@ -350,20 +350,22 @@ func (fs *FileSystem) listObjects(ctx context.Context, parent string, files []mo
}
}
newFile := serializer.Object{
ID: hashid.HashID(file.ID, hashid.FileID),
Name: file.Name,
Path: processedPath,
Pic: file.PicInfo,
Size: file.Size,
Type: "file",
Date: file.CreatedAt,
SourceEnabled: file.GetPolicy().IsOriginLinkEnable,
if !file.Hidden {
newFile := serializer.Object{
ID: hashid.HashID(file.ID, hashid.FileID),
Name: file.Name,
Path: processedPath,
Pic: file.PicInfo,
Size: file.Size,
Type: "file",
Date: file.CreatedAt,
SourceEnabled: file.GetPolicy().IsOriginLinkEnable,
}
if shareKey != "" {
newFile.Key = shareKey
}
objects = append(objects, newFile)
}
if shareKey != "" {
newFile.Key = shareKey
}
objects = append(objects, newFile)
}
return objects