feat(archive viewer): option to select text encoding for zip files (#2867)

This commit is contained in:
Aaron Liu
2025-09-12 15:41:43 +08:00
parent a581851f84
commit 7d97237593
5 changed files with 90 additions and 63 deletions

View File

@@ -720,8 +720,9 @@ func (s *PatchViewService) Patch(c *gin.Context) error {
type (
ArchiveListFilesParamCtx struct{}
ArchiveListFilesService struct {
Uri string `form:"uri" binding:"required"`
Entity string `form:"entity"`
Uri string `form:"uri" binding:"required"`
Entity string `form:"entity"`
TextEncoding string `form:"text_encoding"`
}
)
@@ -739,7 +740,7 @@ func (s *ArchiveListFilesService) List(c *gin.Context) (*ArchiveListFilesRespons
return nil, serializer.NewError(serializer.CodeParamErr, "unknown uri", err)
}
files, err := m.ListArchiveFiles(c, uri, s.Entity)
files, err := m.ListArchiveFiles(c, uri, s.Entity, s.TextEncoding)
if err != nil {
return nil, fmt.Errorf("failed to list archive files: %w", err)
}