mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Refactor: create placeholder file and record upload session id in it
This commit is contained in:
@@ -53,18 +53,19 @@ func (fs *FileSystem) AddFile(ctx context.Context, parent *model.Folder, file fs
|
||||
return nil, err
|
||||
}
|
||||
|
||||
uploadInfo := file.Info()
|
||||
newFile := model.File{
|
||||
Name: file.GetFileName(),
|
||||
SourceName: file.GetSavePath(),
|
||||
Name: uploadInfo.FileName,
|
||||
SourceName: uploadInfo.SavePath,
|
||||
UserID: fs.User.ID,
|
||||
Size: file.GetSize(),
|
||||
Size: uploadInfo.Size,
|
||||
FolderID: parent.ID,
|
||||
PolicyID: fs.Policy.ID,
|
||||
Hidden: file.IsHidden(),
|
||||
MetadataSerialized: file.GetMetadata(),
|
||||
MetadataSerialized: uploadInfo.Metadata,
|
||||
UploadSessionID: uploadInfo.UploadSessionID,
|
||||
}
|
||||
|
||||
if fs.Policy.IsThumbExist(file.GetFileName()) {
|
||||
if fs.Policy.IsThumbExist(uploadInfo.FileName) {
|
||||
newFile.PicInfo = "1,1"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user