mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
feat(archive): support livp as zip archive (#2624)
fix(archive): support livp as zip archive - 将 .livp 注册为 ZIP 压缩包识别格式 - 复用现有 ZIP 解析逻辑支持 LIVP 预览和解压 - 补充 .livp 扩展名注册测试 Signed-off-by: jyxjjj <16695261+jyxjjj@users.noreply.github.com> Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package zip
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/OpenListTeam/OpenList/v4/internal/archive/tool"
|
||||
"github.com/OpenListTeam/OpenList/v4/internal/conf"
|
||||
"github.com/OpenListTeam/OpenList/v4/internal/model"
|
||||
"github.com/OpenListTeam/OpenList/v4/internal/op"
|
||||
@@ -10,6 +11,11 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestZipAcceptsLivpExtension(t *testing.T) {
|
||||
_, ok := tool.Tools[".livp"]
|
||||
require.True(t, ok)
|
||||
}
|
||||
|
||||
func setNonEFSZipEncoding(value string) {
|
||||
op.Cache.SetSetting(conf.NonEFSZipEncoding, &model.SettingItem{
|
||||
Key: conf.NonEFSZipEncoding,
|
||||
|
||||
@@ -17,7 +17,7 @@ type Zip struct {
|
||||
}
|
||||
|
||||
func (z *Zip) AcceptedExtensions() []string {
|
||||
return []string{}
|
||||
return []string{".livp"}
|
||||
}
|
||||
|
||||
func (z *Zip) AcceptedMultipartExtensions() map[string]tool.MultipartExtension {
|
||||
|
||||
Reference in New Issue
Block a user