From a1a49ed4ee419148710b2f102e939000017c67f6 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 22 Sep 2021 11:45:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81tar.gz=E5=8F=8Atgz=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=A7=A3=E5=8E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/attachment.go | 2 +- routers/repo/attachment.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/attachment.go b/models/attachment.go index 2a3bbf9c8..fdd26b8ab 100755 --- a/models/attachment.go +++ b/models/attachment.go @@ -378,7 +378,7 @@ func GetUnDecompressAttachments() ([]*Attachment, error) { func getUnDecompressAttachments(e Engine) ([]*Attachment, error) { attachments := make([]*Attachment, 0, 10) - return attachments, e.Where("decompress_state = ? and dataset_id != 0 and attachment.type = ? and (name like '%.zip' or name like '%.tar.gz')", DecompressStateInit, TypeCloudBrainOne).Find(&attachments) + return attachments, e.Where("decompress_state = ? and dataset_id != 0 and attachment.type = ? and (name like '%.zip' or name like '%.tar.gz' or name like '%.tgz')", DecompressStateInit, TypeCloudBrainOne).Find(&attachments) } func GetAllPublicAttachments() ([]*AttachmentUsername, error) { diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index a20ed9a7d..c62a7b215 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -407,7 +407,7 @@ func AddAttachment(ctx *context.Context) { } func isCanDecompress(name string) bool { - if strings.HasSuffix(name, ".zip") || strings.HasSuffix(name, ".tar.gz") { + if strings.HasSuffix(name, ".zip") || strings.HasSuffix(name, ".tar.gz") || strings.HasSuffix(name, ".tgz") { return true } return false