feat(archive): archive manage (#7817)

* feat(archive): archive management

* fix(ftp-server): remove duplicate ReadAtSeeker realization

* fix(archive): bad seeking of SeekableStream

* fix(archive): split internal and driver extraction api

* feat(archive): patch

* fix(shutdown): clear decompress upload tasks

* chore

* feat(archive): support .iso format

* chore
This commit is contained in:
KirCute_ECT
2025-01-18 23:28:12 +08:00
committed by GitHub
parent ab22cf8233
commit bb40e2e2cd
36 changed files with 2854 additions and 127 deletions

View File

@ -7,6 +7,7 @@ import (
"github.com/alist-org/alist/v3/internal/op"
"github.com/alist-org/alist/v3/internal/task"
log "github.com/sirupsen/logrus"
"io"
)
// the param named path of functions in this package is a mount path
@ -109,6 +110,46 @@ func PutAsTask(ctx context.Context, dstDirPath string, file model.FileStreamer)
return t, err
}
func ArchiveMeta(ctx context.Context, path string, args model.ArchiveMetaArgs) (*model.ArchiveMetaProvider, error) {
meta, err := archiveMeta(ctx, path, args)
if err != nil {
log.Errorf("failed get archive meta %s: %+v", path, err)
}
return meta, err
}
func ArchiveList(ctx context.Context, path string, args model.ArchiveListArgs) ([]model.Obj, error) {
objs, err := archiveList(ctx, path, args)
if err != nil {
log.Errorf("failed list archive [%s]%s: %+v", path, args.InnerPath, err)
}
return objs, err
}
func ArchiveDecompress(ctx context.Context, srcObjPath, dstDirPath string, args model.ArchiveDecompressArgs, lazyCache ...bool) (task.TaskExtensionInfo, error) {
t, err := archiveDecompress(ctx, srcObjPath, dstDirPath, args, lazyCache...)
if err != nil {
log.Errorf("failed decompress [%s]%s: %+v", srcObjPath, args.InnerPath, err)
}
return t, err
}
func ArchiveDriverExtract(ctx context.Context, path string, args model.ArchiveInnerArgs) (*model.Link, model.Obj, error) {
l, obj, err := archiveDriverExtract(ctx, path, args)
if err != nil {
log.Errorf("failed extract [%s]%s: %+v", path, args.InnerPath, err)
}
return l, obj, err
}
func ArchiveInternalExtract(ctx context.Context, path string, args model.ArchiveInnerArgs) (io.ReadCloser, int64, error) {
l, obj, err := archiveInternalExtract(ctx, path, args)
if err != nil {
log.Errorf("failed extract [%s]%s: %+v", path, args.InnerPath, err)
}
return l, obj, err
}
type GetStoragesArgs struct {
}