mirror of https://github.com/cloudreve/Cloudreve
fix: cannot generate thumbnail for COS policy
parent
6af1eeb9fb
commit
d51351eebd
|
@ -284,6 +284,10 @@ func HookPopPlaceholderToFile(picInfo string) Hook {
|
||||||
return func(ctx context.Context, fs *FileSystem, fileHeader fsctx.FileHeader) error {
|
return func(ctx context.Context, fs *FileSystem, fileHeader fsctx.FileHeader) error {
|
||||||
fileInfo := fileHeader.Info()
|
fileInfo := fileHeader.Info()
|
||||||
fileModel := fileInfo.Model.(*model.File)
|
fileModel := fileInfo.Model.(*model.File)
|
||||||
|
if picInfo == "" && fs.Policy.IsThumbExist(fileInfo.FileName) {
|
||||||
|
picInfo = "1,1"
|
||||||
|
}
|
||||||
|
|
||||||
return fileModel.PopChunkToFile(fileInfo.LastModified, picInfo)
|
return fileModel.PopChunkToFile(fileInfo.LastModified, picInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue