Refactor: decide if there is a thumbnail based on the file extension

This commit is contained in:
HFO4
2020-04-22 11:04:35 +08:00
parent 7b571499a7
commit 514e069113
4 changed files with 29 additions and 8 deletions

View File

@@ -63,6 +63,11 @@ func (fs *FileSystem) AddFile(ctx context.Context, parent *model.Folder) (*model
FolderID: parent.ID,
PolicyID: fs.User.Policy.ID,
}
if fs.User.Policy.IsThumbExist(file.GetFileName()) {
newFile.PicInfo = "1,1"
}
_, err = newFile.Create()
if err != nil {