mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-11 19:09:39 +08:00
feat: add support for handling unsupported stream storage in download process
This commit is contained in:
@@ -140,6 +140,10 @@ func (a *Alist) Save(ctx context.Context, reader io.Reader, storagePath string)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *Alist) NotSupportStream() string {
|
||||
return "Alist does not support chunked transfer encoding"
|
||||
}
|
||||
|
||||
func (a *Alist) JoinStoragePath(task types.Task) string {
|
||||
return path.Join(a.config.BasePath, task.StoragePath)
|
||||
}
|
||||
|
||||
@@ -23,6 +23,11 @@ type Storage interface {
|
||||
Save(ctx context.Context, reader io.Reader, storagePath string) error
|
||||
}
|
||||
|
||||
type StorageNotSupportStream interface {
|
||||
Storage
|
||||
NotSupportStream() string
|
||||
}
|
||||
|
||||
var Storages = make(map[string]Storage)
|
||||
|
||||
var UserStorages = make(map[int64][]Storage)
|
||||
|
||||
Reference in New Issue
Block a user